/* ==========================================================================
   飘流查询器网页版 · 基础样式
   ========================================================================== */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-2: #f7f7f8;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-solid: #ffffff;
  --surface-soft: rgba(247, 247, 248, 0.75);
  --text: #1b1b1f;
  --muted: #6f6f78;
  --line: rgba(0, 0, 0, 0.1);
  --line-strong: rgba(0, 0, 0, 0.18);
  --flow-line: rgba(0, 0, 0, 0.26);
  --accent: #1b1b1f;
  --accent-2: #55555f;
  --danger: #d94848;
  --ok: #1f9d63;
  --shadow: 0 16px 44px rgba(0, 0, 0, 0.08);
  --shadow-soft: 0 6px 18px rgba(0, 0, 0, 0.06);
  --radius: 18px;
  --radius-sm: 12px;
  --ds: #1b1b1f;
  --ds-soft: rgba(0, 0, 0, 0.06);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111114;
  --bg-2: #17171b;
  --surface: rgba(26, 26, 31, 0.85);
  --surface-solid: #1a1a1f;
  --surface-soft: rgba(26, 26, 31, 0.55);
  --text: #f2f2f4;
  --muted: #9d9da8;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.2);
  --flow-line: rgba(255, 255, 255, 0.28);
  --accent: #f2f2f4;
  --accent-2: #c9c9d1;
  --danger: #ff7b7b;
  --ok: #4fd39a;
  --shadow: 0 20px 54px rgba(0, 0, 0, 0.55);
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.4);
  --ds: #f2f2f4;
  --ds-soft: rgba(255, 255, 255, 0.09);
}

@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    color-scheme: dark;
    --bg: #111114;
    --bg-2: #17171b;
    --surface: rgba(26, 26, 31, 0.85);
    --surface-solid: #1a1a1f;
    --surface-soft: rgba(26, 26, 31, 0.55);
    --text: #f2f2f4;
    --muted: #9d9da8;
    --line: rgba(255, 255, 255, 0.1);
    --line-strong: rgba(255, 255, 255, 0.2);
    --flow-line: rgba(255, 255, 255, 0.28);
    --accent: #f2f2f4;
    --accent-2: #c9c9d1;
    --danger: #ff7b7b;
    --ok: #4fd39a;
    --shadow: 0 20px 54px rgba(0, 0, 0, 0.55);
    --shadow-soft: 0 8px 24px rgba(0, 0, 0, 0.4);
    --ds: #f2f2f4;
    --ds-soft: rgba(255, 255, 255, 0.09);
  }
}

body[data-ds="equipment"] { --ds: #d93b3b; --ds-soft: rgba(217, 59, 59, 0.14); }
body[data-ds="item"] { --ds: #e8791a; --ds-soft: rgba(232, 121, 26, 0.16); }
body[data-ds="npc"] { --ds: #e0a800; --ds-soft: rgba(224, 168, 0, 0.18); }
body[data-ds="make"] { --ds: #1f9d55; --ds-soft: rgba(31, 157, 85, 0.15); }
body[data-ds="quest"] { --ds: #0e9b96; --ds-soft: rgba(14, 155, 150, 0.15); }
body[data-ds="guide"] { --ds: #6a7ee8; --ds-soft: rgba(106, 126, 232, 0.15); }
body[data-ds="shop"] { --ds: #8b5cf6; --ds-soft: rgba(139, 92, 246, 0.15); }
:root[data-theme="dark"] body[data-ds="equipment"] { --ds: #ff7a7a; --ds-soft: rgba(255, 122, 122, 0.16); }
:root[data-theme="dark"] body[data-ds="item"] { --ds: #ffa457; --ds-soft: rgba(255, 164, 87, 0.16); }
:root[data-theme="dark"] body[data-ds="npc"] { --ds: #ffd84d; --ds-soft: rgba(255, 216, 77, 0.18); }
:root[data-theme="dark"] body[data-ds="make"] { --ds: #4fd58c; --ds-soft: rgba(79, 213, 140, 0.16); }
:root[data-theme="dark"] body[data-ds="quest"] { --ds: #45d6cf; --ds-soft: rgba(69, 214, 207, 0.16); }
:root[data-theme="dark"] body[data-ds="guide"] { --ds: #9aa9ff; --ds-soft: rgba(154, 169, 255, 0.16); }
:root[data-theme="dark"] body[data-ds="shop"] { --ds: #c3a6ff; --ds-soft: rgba(195, 166, 255, 0.18); }
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] body[data-ds="equipment"] { --ds: #ff7a7a; --ds-soft: rgba(255, 122, 122, 0.16); }
  :root[data-theme="auto"] body[data-ds="item"] { --ds: #ffa457; --ds-soft: rgba(255, 164, 87, 0.16); }
  :root[data-theme="auto"] body[data-ds="npc"] { --ds: #ffd84d; --ds-soft: rgba(255, 216, 77, 0.18); }
  :root[data-theme="auto"] body[data-ds="make"] { --ds: #4fd58c; --ds-soft: rgba(79, 213, 140, 0.16); }
  :root[data-theme="auto"] body[data-ds="quest"] { --ds: #45d6cf; --ds-soft: rgba(69, 214, 207, 0.16); }
  :root[data-theme="auto"] body[data-ds="guide"] { --ds: #9aa9ff; --ds-soft: rgba(154, 169, 255, 0.16); }
  :root[data-theme="auto"] body[data-ds="shop"] { --ds: #c3a6ff; --ds-soft: rgba(195, 166, 255, 0.18); }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { min-height: 100%; }

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3, p { margin: 0; }

::selection { background: var(--ds-soft); }

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(16px, 4vw, 44px);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}
.brand:hover { text-decoration: none; }

.brand-mark { display: inline-flex; flex: 0 0 auto; }
.brand-mark img {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.brand-text {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.brand-text small {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--ds);
  background: var(--ds-soft);
  vertical-align: 2px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.nav a {
  padding: 7px 13px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.18s, background 0.18s;
}
.nav a:hover { color: var(--text); background: var(--surface-soft); text-decoration: none; }
.nav a.active { color: var(--ds); background: var(--ds-soft); font-weight: 700; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, transform 0.18s;
}
.icon-btn:hover { background: var(--ds-soft); border-color: transparent; }
.icon-btn:active { transform: scale(0.94); }
.icon-btn.small { width: 28px; height: 28px; font-size: 12px; }

/* --------------------------------------------------------------------------
   页面布局
   -------------------------------------------------------------------------- */

.page {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 3vw, 34px) clamp(14px, 3vw, 30px) 48px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.eyebrow {
  font-size: 11px;
  letter-spacing: 2.6px;
  font-weight: 700;
  color: var(--ds);
  text-transform: uppercase;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: clamp(14px, 2.4vw, 22px);
}

.muted { color: var(--muted); }
.small { font-size: 12px; }
.danger-text { color: var(--danger) !important; }

/* --------------------------------------------------------------------------
   公告条
   -------------------------------------------------------------------------- */

.announce-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--ds);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  font-size: 14px;
}
.announce-tag {
  flex: 0 0 auto;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff;
  background: var(--ds);
}
.announce-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  text-decoration: none;
}
.announce-text:hover { color: var(--ds); text-decoration: none; }

/* --------------------------------------------------------------------------
   首屏与搜索
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: clamp(22px, 4vw, 36px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(560px 240px at 92% 0%, var(--ds-soft), transparent 70%),
    linear-gradient(135deg, var(--surface), var(--surface-soft));
  box-shadow: var(--shadow);
}
.hero::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -90px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 28px solid var(--ds-soft);
  opacity: 0.7;
  pointer-events: none;
}
.hero.compact {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.hero.compact > .btn,
.hero.compact > .hero-copy {
  position: relative;
  z-index: 1;
}
@media (min-width: 880px) {
  .hero-community { padding-right: 176px; }
  .hero-deco-community {
    right: 14px;
    top: 50%;
    bottom: auto;
    height: calc(100% - 14px);
    width: auto;
    opacity: 1;
    filter: drop-shadow(0 14px 26px rgba(140, 82, 240, 0.25));
    animation: deco-float-center 8s ease-in-out infinite;
  }
}
@media (max-width: 879px) {
  .hero-deco-community { display: none; }
}
.hero h1 {
  font-size: clamp(24px, 4vw, 36px);
  line-height: 1.2;
  letter-spacing: 0.5px;
}
.hero-sub { color: var(--muted); font-size: 14px; margin-top: 6px; }

/* 素材抠图装饰 */
.hero-deco {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  user-select: none;
}
.hero-sponsor {
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: none;
  pointer-events: auto;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-drag: none;
}
.hero-sponsor img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.hero-sponsor:focus-visible {
  outline: 3px solid var(--ds);
  outline-offset: 6px;
  border-radius: 18px;
}
@media (min-width: 880px) {
  .hero-home { padding-right: 264px; }
  .hero-home::after { opacity: 0.45; }
  .hero-deco-angel {
    right: 14px;
    top: 50%;
    bottom: auto;
    height: calc(100% - 16px);
    width: auto;
    aspect-ratio: 1 / 1;
    opacity: 0.96;
    filter: drop-shadow(0 16px 28px rgba(0, 0, 0, 0.22));
    animation: deco-float-center 7s ease-in-out infinite;
  }
}
@media (max-width: 879px) {
  .hero-home { padding-right: 84px; }
  .hero-deco-angel {
    display: block;
    right: 8px;
    top: 8px;
    bottom: auto;
    height: 64px;
    width: 64px;
    opacity: 0.95;
  }
}
@keyframes deco-float-center {
  0%, 100% { transform: translateY(-50%); }
  50% { transform: translateY(calc(-50% - 7px)); }
}

:root[data-theme="dark"] .hero-deco-angel {
  opacity: 0.8;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-solid);
  box-shadow: var(--shadow-soft);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.search-box:focus-within {
  border-color: var(--ds);
  box-shadow: 0 0 0 4px var(--ds-soft), var(--shadow-soft);
}
.search-icon { display: inline-flex; color: var(--muted); }
.search-box input {
  flex: 1;
  min-width: 0;
  padding: 9px 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 16px;
}
.search-box input::-webkit-search-cancel-button { display: none; }
.search-hint { font-size: 12px; color: var(--muted); }

/* --------------------------------------------------------------------------
   分类标签
   -------------------------------------------------------------------------- */

.tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.tab {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.18s, background 0.18s;
}
.tab:hover { color: var(--text); background: var(--surface-soft); }
.tab.active {
  color: #fff;
  background: var(--tab-color, var(--ds));
  box-shadow: 0 8px 18px -8px var(--tab-color, var(--ds));
}
.tab[data-key="npc"].active { color: #2b1d00; }
.tab .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.8;
}
@media (max-width: 680px) {
  .tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-radius: 16px;
  }
  .tab {
    gap: 6px;
    padding: 8px 6px;
    font-size: 13px;
  }
}

/* --------------------------------------------------------------------------
   筛选区与按钮
   -------------------------------------------------------------------------- */

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}
.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.filter-row.actions { margin-left: auto; }

.filter-row label,
.inline-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

select, input[type="text"], input[type="search"], input[type="password"], textarea {
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-solid);
  color: var(--text);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  max-width: 100%;
}
select:focus, input:focus, textarea:focus {
  border-color: var(--ds);
  box-shadow: 0 0 0 3px var(--ds-soft);
}
textarea { resize: vertical; min-height: 90px; line-height: 1.6; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-solid);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.18s, background 0.18s, color 0.18s;
  text-decoration: none;
}
.btn:hover { border-color: var(--ds); color: var(--ds); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary {
  border-color: transparent;
  background: var(--text);
  color: var(--bg);
  box-shadow: 0 10px 20px -10px rgba(0, 0, 0, 0.35);
}
.btn.primary:hover { color: var(--bg); filter: brightness(1.08); }
.btn.flow-open-btn {
  border-color: transparent;
  background: linear-gradient(100deg, #7b5cff 0%, #b45cf0 52%, #ef6fb8 100%);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-radius: 10px;
  padding: 8px 18px;
  box-shadow: 0 10px 20px -10px rgba(140, 82, 240, 0.7);
}
.btn.flow-open-btn:hover {
  color: #fff;
  filter: brightness(1.07);
  box-shadow: 0 12px 24px -10px rgba(140, 82, 240, 0.8);
}
.btn.ghost { background: var(--surface-soft); }
.btn.small { padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.btn.danger { border-color: transparent; background: var(--danger); color: #fff; }
.btn.danger:hover { color: #fff; filter: brightness(1.05); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.chip {
  padding: 6px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-solid);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.18s;
}
.chip:hover { color: var(--ds); border-color: var(--ds); }
.chip.active {
  color: #fff;
  border-color: transparent;
  background: var(--ds);
}

/* --------------------------------------------------------------------------
   结果区
   -------------------------------------------------------------------------- */

.results { padding: clamp(12px, 2vw, 20px); }

.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.results-title { display: flex; align-items: baseline; gap: 10px; }
.results-title strong { font-size: 17px; }
.results-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
  -webkit-overflow-scrolling: touch;
}

.result-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  font-size: 13.5px;
}
.result-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 11px 12px;
  text-align: left;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-solid);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  user-select: none;
}
.result-table th:hover { color: var(--ds); }
.result-table th .sort-ind { margin-left: 4px; opacity: 0.75; font-size: 10px; }
.result-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.result-table tbody tr { cursor: pointer; transition: background 0.14s; }
.result-table tbody tr:hover { background: var(--ds-soft); }
.result-table tbody tr.active { background: var(--ds-soft); }
.result-table tbody tr:last-child td { border-bottom: 0; }

.name-cell { min-width: 150px; }
.name-inner {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-align: left;
  border: 0;
  background: none;
  padding: 0;
  color: var(--ds);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
}
.name-inner:hover { text-decoration: underline; }
.name-inner img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  border-radius: 7px;
  background: var(--surface-soft);
  flex: 0 0 auto;
}
.name-inner .no-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--ds-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--ds);
  flex: 0 0 auto;
}

.mark-btn {
  border: 0;
  background: none;
  font-size: 18px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 8px;
}
.mark-btn:hover { background: var(--ds-soft); }
.mark-btn.marked { color: #ef4444; }

/* 分页 */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}
.pager button {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-solid);
  color: var(--text);
  cursor: pointer;
}
.pager button:hover:not(:disabled) { border-color: var(--ds); color: var(--ds); }
.pager button.active { background: var(--ds); border-color: transparent; color: #fff; }
.pager button:disabled { opacity: 0.4; cursor: not-allowed; }
.pager .pager-info { padding: 0 8px; color: var(--muted); font-size: 13px; }

.empty {
  padding: 44px 16px;
  text-align: center;
  color: var(--text);
}
.empty p { margin: 4px 0; }
.empty-icon {
  font-size: 40px;
  color: var(--muted);
  opacity: 0.5;
  margin-bottom: 8px;
}

.spinner {
  width: 30px;
  height: 30px;
  margin: 0 auto 10px;
  border: 3px solid var(--line-strong);
  border-top-color: var(--ds);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   攻略列表
   -------------------------------------------------------------------------- */

.guide-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.guide-item {
  display: flex;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
  transition: border-color 0.18s, transform 0.18s;
}
.guide-item:hover { border-color: var(--ds); transform: translateY(-2px); }
.guide-item.clickable { cursor: pointer; }
.guide-item.clickable:focus-visible { outline: 2px solid var(--ds); outline-offset: 2px; }
.guide-detail-meta {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12.5px;
}
.guide-text { max-height: none; }
.guide-summary {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.guide-article {
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--text);
  word-break: break-word;
}
.guide-article h1,
.guide-article h2,
.guide-article h3 {
  margin: 18px 0 10px;
  line-height: 1.35;
}
.guide-article h1 { font-size: 22px; }
.guide-article h2 { font-size: 19px; }
.guide-article h3 { font-size: 16.5px; }
.guide-article p { margin: 10px 0; }
.guide-article ul,
.guide-article ol { margin: 10px 0; padding-left: 24px; }
.guide-article li { margin: 4px 0; }
.guide-article blockquote {
  margin: 12px 0;
  padding: 8px 14px;
  border-left: 3px solid var(--ds);
  background: var(--ds-soft);
  border-radius: 0 8px 8px 0;
}
.guide-article a { color: var(--ds); text-decoration: underline; }
.guide-article img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  vertical-align: middle;
}
/* 前台文章不再套用 SunEditor 编辑区样式，这里补回图片对齐 */
.guide-article .se-image-container { max-width: 100%; }
.guide-article .se-image-container img { max-width: 100%; height: auto; }
.guide-article .__se__float-left { float: left; margin-right: 12px; margin-bottom: 6px; }
.guide-article .__se__float-right { float: right; margin-left: 12px; margin-bottom: 6px; }
.guide-article .__se__float-center { margin-left: auto; margin-right: auto; }
.guide-article .__se__float-left figure,
.guide-article .__se__float-right figure,
.guide-article .__se__float-center figure { margin: 0; }
.guide-article::after { content: ""; display: block; clear: both; }
.guide-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13.5px;
}
.guide-article th,
.guide-article td {
  border: 1px solid var(--line);
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
}
.guide-article th { background: var(--ds-soft); font-weight: 700; }
.guide-article pre,
.guide-article .guide-pre {
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2, rgba(0, 0, 0, 0.04));
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 13px;
  line-height: 1.65;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace;
}
.guide-article hr { border: none; border-top: 1px solid var(--line); margin: 18px 0; }
.guide-icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--ds);
  background: var(--ds-soft);
  text-transform: uppercase;
}
.guide-info { min-width: 0; flex: 1; }
.guide-name {
  font-weight: 700;
  font-size: 14px;
  word-break: break-all;
  display: block;
  color: var(--ds);
}
.guide-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.guide-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.guide-actions .btn { padding: 4px 10px; font-size: 12px; border-radius: 8px; }
.guide-folder {
  grid-column: 1 / -1;
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.guide-folder::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* --------------------------------------------------------------------------
   详情抽屉
   -------------------------------------------------------------------------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(6, 14, 26, 0.42);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.drawer {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 90;
  width: min(900px, calc(100% - 32px));
  height: min(75vh, 900px);
  display: flex;
  flex-direction: column;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -46%) scale(0.98);
  transition: transform 0.24s cubic-bezier(0.22, 0.8, 0.3, 1), opacity 0.2s ease;
}
.drawer.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h2 {
  flex: 1;
  font-size: 17px;
  line-height: 1.35;
  text-align: center;
  word-break: break-all;
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.detail-top {
  display: flex;
  align-items: center;
  gap: 14px;
}
.detail-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--ds-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 auto;
}
.detail-icon img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  image-rendering: pixelated;
}
.detail-title { font-size: 20px; font-weight: 800; line-height: 1.3; }
.detail-sub { color: var(--muted); font-size: 13px; margin-top: 3px; }

.detail-fields { display: flex; flex-direction: column; gap: 0; }
.detail-field {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}
.detail-field:last-child { border-bottom: 0; }
.detail-field dt { color: var(--muted); font-size: 13px; }
.detail-field dd { margin: 0; word-break: break-word; white-space: pre-wrap; }

.detail-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(62px, 1fr));
  gap: 8px;
  margin: 12px 0 4px;
}
.detail-stat {
  padding: 8px 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  text-align: center;
}
.detail-stat dt {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
}
.detail-stat dd {
  margin: 3px 0 0;
  font-size: 15px;
  font-weight: 700;
}

.drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 15px 15px calc(15px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface-solid);
}
.drawer-actions:empty { display: none; }

/* --------------------------------------------------------------------------
   模态框
   -------------------------------------------------------------------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.modal-card {
  position: relative;
  width: min(680px, 100%);
  max-height: min(86vh, 900px);
  display: flex;
  flex-direction: column;
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.modal-card.wide { width: min(980px, 100%); }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-size: 17px; }
.modal-body { padding: 18px; overflow: auto; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
}
.image-card { width: min(760px, 100%); }
.image-card .modal-body { padding: 8px; text-align: center; }
.image-card img { max-width: 100%; height: auto; border-radius: 10px; display: block; margin: 0 auto; }

/* 详情 / 流程导图翻页动画 */
@keyframes drawerPageNext {
  from { opacity: 0; transform: translateX(26px); }
  to { opacity: 1; transform: none; }
}
@keyframes drawerPageBack {
  from { opacity: 0; transform: translateX(-26px); }
  to { opacity: 1; transform: none; }
}
.drawer-body.page-next { animation: drawerPageNext 0.26s cubic-bezier(0.22, 0.8, 0.3, 1); }
.drawer-body.page-back { animation: drawerPageBack 0.26s cubic-bezier(0.22, 0.8, 0.3, 1); }
.flow-tree,
.flow-tree ul {
  list-style: none;
  margin: 0;
  padding-left: 0;
}
.flow-tree ul {
  margin-left: 20px;
  padding-left: 14px;
  border-left: 2px solid var(--flow-line);
}
.flow-tree li { position: relative; padding: 2px 0; }
.flow-tree ul > li::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 22px;
  width: 12px;
  border-top: 2px solid var(--flow-line);
}
.flow-node {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 5px 8px;
  font-size: 14px;
}
.flow-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.flow-icon img { width: 100%; height: 100%; object-fit: contain; }
.flow-label { word-break: break-word; }
.flow-toggle {
  flex: 0 0 auto;
  margin-left: 2px;
  padding: 1px 9px;
  border: 1px solid var(--danger);
  border-radius: 999px;
  background: transparent;
  color: var(--danger);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}
.flow-toggle:hover {
  background: var(--danger);
  color: #fff;
}
.flow-toggle-root {
  margin-left: auto;
}
.flow-toggle.open {
  border-color: var(--line-strong);
  color: var(--muted);
}
.flow-toggle.open:hover {
  background: var(--line-strong);
  color: #fff;
}
.flow-note {
  margin: 1px 0 4px 40px;
  color: var(--muted);
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}
.flow-tool-icon {
  width: 16px;
  height: 16px;
  margin: 0 2px;
  border-radius: 4px;
  object-fit: contain;
  vertical-align: -3px;
}
.flow-source {
  margin: 1px 0 4px 40px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}
.flow-stats {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}
.flow-stats h3 {
  margin: 0 0 10px;
  font-size: 14px;
}
.flow-stats-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.flow-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 12px;
}
.flow-stat-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 4px;
}
.flow-stat-icon.emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  background: var(--surface-soft);
}
.flow-stat-qty {
  color: var(--accent);
  font-weight: 600;
}
.flow-fields {
  margin: 3px 0 6px 40px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}
.flow-field {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 8px;
  padding: 2px 0;
  font-size: 12px;
}
.flow-field dt { color: var(--muted); }
.flow-field dd {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.preview-image { max-width: 100%; border-radius: 10px; display: block; margin: 0 auto; }
.preview-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.7;
  background: var(--surface-soft);
  border-radius: 10px;
  padding: 14px;
  max-height: 60vh;
  overflow: auto;
}

/* --------------------------------------------------------------------------
   公告与留言页
   -------------------------------------------------------------------------- */

.community-page { gap: 20px; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.section-head h2 { font-size: 18px; }

.announce-list { display: flex; flex-direction: column; gap: 12px; }
.announce-card {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--ds);
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
}
.announce-card.pinned { border-left-color: var(--danger); }
.announce-card h3 { font-size: 16px; }
.announce-card .meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}
.pin-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--danger);
  margin-right: 6px;
  vertical-align: 1px;
}
.notice-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  margin-right: 6px;
  vertical-align: 1px;
}
.notice-tag.notice { background: var(--ok); }
.notice-tag.pinned { background: var(--danger); }
.announce-content {
  margin-top: 10px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  color: var(--text);
}

.message-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  margin-bottom: 20px;
}
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row label { flex: 1 1 220px; }
.message-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.message-form input, .message-form textarea { width: 100%; }
.form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.form-error { color: var(--danger); font-size: 13px; margin-top: 10px; }
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.message-list { display: flex; flex-direction: column; gap: 10px; }
.message-item {
  display: flex;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-solid);
}
.message-avatar {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--ds), var(--accent-2));
  font-size: 15px;
  user-select: none;
}
.message-main { min-width: 0; flex: 1; }
.message-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.message-nick { font-weight: 700; font-size: 14px; }
.message-time { color: var(--muted); font-size: 12px; }
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}
.status-badge.pending {
  background: rgba(240, 140, 27, 0.14);
  color: #c47a16;
}
.status-badge.fixed {
  background: rgba(26, 159, 108, 0.14);
  color: var(--ok);
}
.status-badge.accepted {
  background: var(--ds-soft);
  color: var(--accent);
}
.status-badge.rejected {
  background: rgba(138, 127, 161, 0.16);
  color: var(--muted);
}
:root[data-theme="dark"] .status-badge.pending { color: #ffb066; }
.message-content {
  margin-top: 5px;
  font-size: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* --------------------------------------------------------------------------
   页脚、Toast
   -------------------------------------------------------------------------- */

.footer {
  position: relative;
  padding: 22px clamp(16px, 4vw, 44px) 30px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  width: min(1180px, 100%);
  margin: 0 auto;
}
.footer-credit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.footer-credit-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  opacity: 0.9;
  pointer-events: none;
  user-select: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom));
  z-index: 100;
  transform: translateX(-50%);
  max-width: min(90vw, 480px);
  padding: 11px 18px;
  border-radius: 999px;
  background: rgba(18, 28, 44, 0.92);
  color: #fff;
  font-size: 13.5px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
  animation: toastIn 0.24s ease;
  text-align: center;
}
.toast.error { background: rgba(198, 58, 58, 0.95); }
.toast.ok { background: rgba(22, 140, 96, 0.95); }
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* --------------------------------------------------------------------------
   响应式：手机
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .result-table { min-width: 720px; }
}

@media (max-width: 760px) {
  .topbar { padding: 10px 14px; gap: 8px; }
  .brand-text { font-size: 16px; }
  .brand-text small { display: none; }
  .nav { gap: 2px; }
  .nav a { padding: 6px 9px; font-size: 13px; }
  .nav a:nth-child(4) { display: none; }
  .page { padding: 14px 12px 40px; gap: 14px; }
  .hero { padding: 20px 18px; border-radius: 20px; }
  .hero.compact { flex-direction: column; align-items: flex-start; }
  .hero h1 { font-size: 25px; }
  .tabs { border-radius: 14px; }
  .tab { padding: 8px 14px; font-size: 13px; }
  .filters { gap: 10px; }
  .filter-row { width: 100%; }
  .filter-row.actions { margin-left: 0; }
  .filter-row label { flex: 1 1 45%; }
  .filter-row label select { flex: 1; width: 100%; }
  .announce-bar { font-size: 13px; }

  /* 表格转卡片 */
  .result-table { min-width: 0; display: block; }
  .result-table thead { display: none; }
  .result-table tbody { display: flex; flex-direction: column; gap: 10px; padding: 4px; }
  .result-table tbody tr {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    padding: 12px 14px !important;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-solid);
    box-shadow: var(--shadow-soft);
  }
  .result-table tbody tr:hover { background: var(--surface-solid); }
  .result-table td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex: 1 1 46%;
    min-width: 0;
    padding: 4px 0 !important;
    border: 0 !important;
    text-align: right;
    font-size: 13px;
  }
  .result-table td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
  }
  .result-table td[data-mobile="false"] { display: none; }
  .result-table td.name-cell {
    flex: 1 1 100%;
    order: -2;
    justify-content: flex-start;
    text-align: left;
    padding: 0 0 9px !important;
    margin-bottom: 6px;
    border-bottom: 1px dashed var(--line) !important;
  }
  .result-table td.name-cell::before { content: none; }
  .result-table td.mark-cell {
    flex: 0 0 auto;
    order: -1;
    margin-left: auto;
    padding: 0 0 6px !important;
  }
  .result-table td.mark-cell::before { content: none; }
  .table-wrap { border: 0; background: transparent; overflow: visible; }
  .name-inner { font-size: 15px; }
  .name-inner img, .name-inner .no-icon { width: 36px; height: 36px; }

  .drawer { width: calc(100% - 20px); height: 75dvh; }
  .detail-field { grid-template-columns: 78px 1fr; }
  .modal { padding: 10px; }
  .modal-card { max-height: 90vh; border-radius: 16px; }
  .footer-inner { flex-direction: column; gap: 4px; }
  .guide-list { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .results-tools { width: 100%; justify-content: space-between; }
}

/* 赞助支持 */
.sponsor-box {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.sponsor-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-solid);
}

.hero-sub-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 6px;
}
.hero-sub-line .hero-sub { margin-top: 0; }
.hero-home > .hero-copy,
.hero-community > .hero-copy {
  position: relative;
  z-index: 1;
}
