/* Mistfall 出海导航 · 晨雾与灯塔
   雾层: 冷灰蓝渐层 | 信号: 灯塔琥珀 | 零外部依赖 */

:root {
  --mist-0: #edf1f6;   /* 页面基底: 晨雾 */
  --mist-1: #e0e7f0;   /* 远山一层 */
  --mist-2: #c9d4e2;   /* 远山二层 */
  --card:   #fbfdff;
  --line:   #d8dfe9;
  --ink:    #1b2534;   /* 主文字: 墨 */
  --fog:    #5a6b80;   /* 次文字: 雾灰 */
  --lamp:   #b35a0a;   /* 灯塔琥珀 */
  --lamp-soft: #f2b96b;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, "Courier New", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--mist-0);
  line-height: 1.6;
}

a { color: inherit; }

/* ---------- 顶部: 雾 ---------- */

.masthead {
  position: relative;
  overflow: hidden;
  padding: 4.5rem 1.25rem 5.5rem;
  background: linear-gradient(180deg, #e6ecf4 0%, var(--mist-0) 100%);
}

.ridges {
  position: absolute;
  inset: auto 0 0 0;
  width: 100%;
  height: 62%;
}

.ridge { transform-origin: 50% 100%; }

.r1 { fill: #dce4ee; opacity: .9; }
.r2 { fill: var(--mist-1); opacity: .75; }
.r3 { fill: var(--mist-2); opacity: .45; }

/* 签名动效: 雾层漂移散开 */
.r1 { animation: drift1 2.4s cubic-bezier(.2,.7,.2,1) both; }
.r2 { animation: drift2 2.4s .15s cubic-bezier(.2,.7,.2,1) both; }
.r3 { animation: drift3 2.4s .3s  cubic-bezier(.2,.7,.2,1) both; }

@keyframes drift1 { from { transform: translateX(0)    scaleY(1.6); } to { transform: translateX(0); } }
@keyframes drift2 { from { transform: translateX(6%)  scaleY(1.5); } to { transform: translateX(0); } }
@keyframes drift3 { from { transform: translateX(-8%) scaleY(1.4); } to { transform: translateX(0); } }

@media (prefers-reduced-motion: reduce) {
  .ridge { animation: none; }
  html { scroll-behavior: auto; }
}

.ghost {
  position: absolute;
  right: -1rem;
  top: 50%;
  transform: translateY(-46%);
  font-family: "Songti SC", "Noto Serif CJK SC", SimSun, serif;
  font-size: clamp(9rem, 22vw, 17rem);
  line-height: 1;
  color: var(--mist-2);
  opacity: .38;
  user-select: none;
  pointer-events: none;
}

.masthead-inner {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
}

.kicker {
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .18em;
  color: var(--fog);
  margin: 0 0 .6rem;
}

.masthead h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.1rem);
  font-weight: 640;
  letter-spacing: .04em;
  line-height: 1.15;
}

.masthead h1 .zh {
  font-weight: 400;
  color: var(--fog);
}

.tagline {
  margin: .8rem 0 0;
  color: var(--fog);
  font-size: .95rem;
}

/* ---------- 吸顶栏 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .6rem 1.25rem;
  background: rgba(237, 241, 246, .88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--ink);
  color: var(--lamp-soft);
  font-family: "Songti SC", "Noto Serif CJK SC", SimSun, serif;
  font-size: 15px;
}

.brand-name {
  font-weight: 640;
  letter-spacing: .03em;
}

.searchbox {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex: 1;
  max-width: 420px;
  margin-left: auto;
  padding: .42rem .8rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--fog);
  transition: border-color .15s, box-shadow .15s;
}

.searchbox:focus-within {
  border-color: var(--lamp);
  box-shadow: 0 0 0 3px rgba(179, 90, 10, .12);
}

.searchbox input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--ink);
  outline: none;
}

.searchbox input::placeholder { color: #93a1b3; }

/* ---------- 主体两栏 ---------- */

.layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 2.5rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.rail { position: relative; min-width: 0; }

.content { min-width: 0; }

.rail-nav {
  position: sticky;
  top: 64px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 1px solid var(--line);
}

.rail-nav a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .5rem;
  padding: .42rem .85rem;
  border-left: 2px solid transparent;
  margin-left: -1px;
  text-decoration: none;
  font-size: .88rem;
  color: var(--fog);
  transition: color .12s, border-color .12s, background .12s;
}

.rail-nav a .cnt {
  font-family: var(--mono);
  font-size: .7rem;
  color: #93a1b3;
}

.rail-nav a:hover { color: var(--ink); }

.rail-nav a.active {
  color: var(--lamp);
  border-left-color: var(--lamp);
  font-weight: 600;
}

.rail-note {
  position: sticky;
  top: 300px;
  margin-top: 2rem;
  padding: .9rem .95rem;
  font-size: .74rem;
  color: var(--fog);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.rail-note .submit {
  color: var(--lamp);
  text-decoration: none;
  font-weight: 600;
}

.rail-note .submit:hover { text-decoration: underline; }

/* ---------- 分区与卡片 ---------- */

.section { margin-bottom: 3rem; scroll-margin-top: 84px; }

.eyebrow {
  display: flex;
  align-items: baseline;
  gap: .8rem;
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .14em;
  color: var(--fog);
  margin-bottom: 1.1rem;
}

.eyebrow .no { color: var(--lamp); }

.eyebrow .t {
  font-family: var(--sans);
  font-size: 1.12rem;
  font-weight: 640;
  letter-spacing: .02em;
  color: var(--ink);
}

.eyebrow .rule { flex: 1; height: 1px; background: var(--line); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: .9rem;
}

.card {
  position: relative;
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  overflow: hidden;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--lamp);
  opacity: 0;
  transition: opacity .16s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--mist-2);
  box-shadow: 0 10px 24px -14px rgba(27, 37, 52, .35);
}

.card:hover::before { opacity: 1; }

.avatar {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  font-size: 1.02rem;
  font-weight: 640;
  background: var(--mist-1);
  color: var(--ink);
}

.card .meta { min-width: 0; }

.card .nm {
  font-weight: 640;
  font-size: .95rem;
  margin: 0 0 .15rem;
}

.card .host {
  font-family: var(--mono);
  font-size: .68rem;
  color: #93a1b3;
  display: block;
  margin-bottom: .3rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card .ds {
  margin: 0;
  font-size: .8rem;
  color: var(--fog);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card mark {
  background: rgba(242, 185, 107, .45);
  color: inherit;
  border-radius: 2px;
}

.card .dot {
  position: absolute;
  right: .8rem;
  top: .8rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lamp-soft);
  display: none;
}

.card[data-affiliate="1"] .dot { display: block; }

.empty {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--fog);
  font-size: .92rem;
  border: 1px dashed var(--line);
  border-radius: 12px;
}

.engines {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  margin-top: 1rem;
}

.engines a {
  color: var(--lamp);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid transparent;
}

.engines a:hover { border-bottom-color: var(--lamp); }

.noscript-hint {
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
}

/* ---------- 页脚 ---------- */

.footer {
  padding: 2rem 1.25rem 3rem;
  text-align: center;
  color: var(--fog);
  font-size: .82rem;
}

.footer p { margin: .25rem 0; }

.footer a { color: var(--lamp); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

/* ---------- 响应式 ---------- */

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .rail-nav {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    border-left: 0;
    padding-bottom: .3rem;
    -webkit-overflow-scrolling: touch;
  }

  .rail-nav a {
    flex-shrink: 0;
    border-left: 0;
    border-bottom: 2px solid transparent;
    padding: .35rem .7rem;
  }

  .rail-nav a.active {
    border-left: 0;
    border-bottom-color: var(--lamp);
  }

  .rail-note { display: none; }

  .ghost { opacity: .22; }

  .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
  .brand-name { display: none; }
}

/* ---------- 可访问性 ---------- */

:focus-visible {
  outline: 2px solid var(--lamp);
  outline-offset: 2px;
  border-radius: 4px;
}
