:root {
  --canvas: #eef1f4;
  --paper: #ffffff;
  --ink: #17191d;
  --muted: #69717d;
  --line: #d9dfe6;
  --line-strong: #c4ccd6;
  --red: #d52941;
  --red-soft: #fff0f2;
  --amber: #c96d00;
  --amber-soft: #fff5dd;
  --teal: #087f78;
  --teal-soft: #e7f7f5;
  --blue: #3156a3;
  --blue-soft: #edf2ff;
  --shadow: 0 18px 50px rgba(24, 32, 45, 0.14);
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  letter-spacing: 0;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--canvas); }
button, input, select { font: inherit; letter-spacing: 0; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid rgba(49, 86, 163, 0.28);
  outline-offset: 2px;
}

.app-header {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}
.brand-block { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 34px; height: 34px; display: flex; align-items: end; gap: 3px; padding: 7px; background: var(--ink); border-radius: 5px; }
.brand-mark span { width: 5px; background: var(--paper); border-radius: 1px; }
.brand-mark span:nth-child(1) { height: 8px; }
.brand-mark span:nth-child(2) { height: 18px; background: #ff5368; }
.brand-mark span:nth-child(3) { height: 13px; }
.brand-name { font-size: 17px; font-weight: 800; line-height: 1.1; }
.brand-subtitle { margin-top: 3px; font-size: 11px; color: var(--muted); }
.header-actions { display: flex; align-items: center; gap: 8px; }
.sync-state { display: flex; align-items: center; gap: 7px; margin-right: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }
.sync-state.running .status-dot { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); animation: pulse 1.2s infinite; }
.sync-state.error .status-dot { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }

.button { height: 38px; padding: 0 14px; border-radius: 5px; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 700; font-size: 13px; }
.button.primary { background: var(--ink); color: #fff; }
.button.primary:hover { background: #2b2e34; }
.button.secondary { background: #fff; border-color: var(--line-strong); color: var(--ink); }
.button.secondary:hover { background: #f7f8fa; }
.button:disabled { opacity: 0.55; cursor: wait; }
.refresh-icon { font-size: 18px; line-height: 1; }
.running .refresh-icon, .button.loading .refresh-icon { animation: spin 0.8s linear infinite; }

.metric-band {
  min-height: 86px;
  display: grid;
  grid-template-columns: repeat(6, minmax(100px, 1fr)) minmax(170px, 1.25fr);
  align-items: stretch;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
}
.metric { display: flex; align-items: baseline; justify-content: center; gap: 8px; padding: 24px 14px 18px; border-right: 1px solid var(--line); }
.metric:first-child { border-left: 1px solid var(--line); }
.metric-value { font-family: "Segoe UI", sans-serif; font-size: 28px; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; }
.metric-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.primary-metric .metric-value { color: var(--amber); }
.hot-metric .metric-value { color: var(--red); }
.potential-metric .metric-value { color: var(--blue); }
.metric-time { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 5px; padding-left: 18px; font-size: 11px; color: var(--muted); }
.metric-time strong { color: var(--ink); font-size: 12px; font-weight: 700; }
.metric-time small { max-width: 190px; color: var(--blue); font-size: 10px; line-height: 1.35; text-align: right; }

.workspace { max-width: 1560px; margin: 0 auto; display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: calc(100vh - 154px); }
.filter-rail { padding: 20px 18px 30px; border-right: 1px solid var(--line); background: #f5f7f9; }
.search-wrap { height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 11px; background: var(--paper); border: 1px solid var(--line-strong); border-radius: 5px; }
.search-wrap span { font-size: 21px; color: var(--muted); transform: rotate(-15deg); }
.search-wrap input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; }
.filter-group { margin-top: 22px; }
.filter-label, .select-field > span { display: block; margin-bottom: 9px; color: #535b66; font-size: 11px; font-weight: 800; }
.filter-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.filter-label-row .filter-label { margin-bottom: 9px; }
.filter-label-row b { margin-bottom: 9px; color: var(--red); font-size: 11px; font-variant-numeric: tabular-nums; }
.segmented { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line-strong); border-radius: 5px; overflow: hidden; background: var(--paper); }
.segmented.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.segmented button { height: 32px; padding: 0 5px; border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 12px; }
.segmented button:last-child { border-right: 0; }
.segmented button.active { background: var(--ink); color: #fff; font-weight: 700; }
.account-filter-form { display: grid; grid-template-columns: minmax(0, 1fr) 34px; gap: 6px; }
.account-filter-form input { width: 100%; min-width: 0; height: 34px; padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--paper); color: var(--ink); font-size: 12px; }
.account-filter-form .icon-button { width: 34px; height: 34px; font-size: 18px; }
.excluded-author-list { display: flex; flex-direction: column; gap: 3px; margin-top: 7px; }
.excluded-author-item { min-height: 30px; display: grid; grid-template-columns: minmax(0, 1fr) 26px; align-items: center; gap: 5px; padding: 0 4px 0 9px; border-left: 3px solid var(--red); background: var(--paper); color: #4f5660; font-size: 11px; }
.excluded-author-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.excluded-author-item button { width: 24px; height: 24px; border: 0; border-radius: 3px; background: transparent; color: #8a919b; font-size: 16px; }
.excluded-author-item button:hover { background: var(--red-soft); color: var(--red); }
.excluded-author-empty { color: #9299a3; font-size: 10px; line-height: 1.5; }
.select-field { display: block; margin-top: 20px; }
.select-field select { width: 100%; height: 36px; padding: 0 30px 0 10px; color: var(--ink); background: var(--paper); border: 1px solid var(--line-strong); border-radius: 5px; font-size: 12px; }
.category-list { display: flex; flex-direction: column; gap: 2px; }
.category-item { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 0; border-radius: 4px; padding: 0 10px; background: transparent; color: var(--muted); font-size: 12px; text-align: left; }
.category-item:hover { background: #e9edf1; color: var(--ink); }
.category-item.active { background: var(--paper); color: var(--ink); box-shadow: inset 3px 0 var(--red); font-weight: 700; }
.category-item b { font-size: 11px; color: #89919c; font-variant-numeric: tabular-nums; }

.feed-panel { min-width: 0; padding: 20px 24px 50px; background: var(--paper); }
.feed-toolbar { display: flex; align-items: flex-end; justify-content: space-between; min-height: 45px; margin-bottom: 14px; }
.feed-toolbar h1 { margin: 0; font-size: 19px; line-height: 1.25; }
.feed-toolbar p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.icon-button { width: 34px; height: 34px; display: inline-grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--paper); color: var(--ink); font-size: 20px; }
.icon-button:hover { background: #f5f7f9; }
.mobile-filter-button { display: none; }

.cluster-strip { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 8px 10px; margin: 0 0 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fafbfc; overflow: hidden; }
.cluster-heading { flex: 0 0 auto; color: var(--muted); font-size: 11px; font-weight: 800; }
.cluster-list { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: thin; }
.cluster-chip { height: 28px; flex: 0 0 auto; padding: 0 9px; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--ink); font-size: 11px; }
.cluster-chip b { margin-left: 5px; color: var(--red); }

.feed-head { display: grid; grid-template-columns: 92px minmax(0, 1fr) 110px 92px; gap: 12px; align-items: center; height: 34px; padding: 0 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #f8f9fa; color: var(--muted); font-size: 10px; font-weight: 800; }
.article-list { min-height: 260px; }
.article-row { position: relative; display: grid; grid-template-columns: 92px minmax(0, 1fr) 110px 92px; gap: 12px; align-items: center; min-height: 106px; padding: 14px 12px 14px 16px; border-bottom: 1px solid var(--line); transition: background 120ms ease; }
.article-row:hover { background: #fafbfc; }
.article-row::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 2px 2px 0; background: var(--amber); }
.article-row.is-hot::before { background: var(--red); }
.article-row.is-rising::before { background: var(--teal); }
.article-row.is-potential::before { background: var(--blue); }
.comment-pulse { display: flex; flex-direction: column; align-items: flex-start; }
.comment-number { font-family: "Segoe UI", sans-serif; font-size: 26px; line-height: 1; font-weight: 850; font-variant-numeric: tabular-nums; }
.is-hot .comment-number { color: var(--red); }
.comment-caption { margin-top: 6px; color: var(--muted); font-size: 10px; }
.comment-growth { margin-top: 5px; color: var(--teal); font-size: 11px; font-weight: 800; }
.article-main { min-width: 0; }
.article-main.has-image { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 12px; align-items: start; }
.article-thumb { width: 82px; height: 58px; object-fit: cover; border-radius: 4px; background: #e7ebef; }
.article-copy { min-width: 0; }
.article-title { margin: 0; color: var(--ink); font-family: "Microsoft YaHei UI", sans-serif; font-size: 15px; line-height: 1.55; font-weight: 750; cursor: pointer; }
.article-title:hover { color: var(--blue); }
.article-meta { display: flex; flex-wrap: wrap; gap: 7px 12px; margin-top: 8px; color: var(--muted); font-size: 11px; }
.article-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.tag { min-height: 22px; display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 3px; background: #f0f2f4; color: #59616c; font-size: 10px; }
.tag.risk-medium { background: var(--amber-soft); color: #8d4f00; }
.tag.risk-high { background: var(--red-soft); color: #a51d31; }
.tag.status-saved { background: var(--blue-soft); color: var(--blue); }
.tag.status-used { background: var(--teal-soft); color: var(--teal); }
.tag.status-ignored { color: #8b929b; text-decoration: line-through; }
.tag.potential-tag { background: var(--blue-soft); color: var(--blue); }
.tag.platform-tencent { background: #eef3ff; color: #3156a3; }
.tag.platform-netease { background: #fff0f2; color: #b42338; }
.tag.platform-toutiao { background: #fff2e8; color: #b54708; }
.used-toggle { min-height: 22px; display: inline-flex; align-items: center; gap: 5px; padding: 2px 7px; border: 1px solid var(--line-strong); border-radius: 3px; background: #fff; color: #59616c; font-size: 10px; cursor: pointer; }
.used-toggle:hover { background: #f5f7f9; color: var(--ink); }
.used-toggle input { width: 14px; height: 14px; margin: 0; accent-color: var(--teal); cursor: pointer; }
.used-toggle:has(input:checked) { border-color: #9fcac6; background: var(--teal-soft); color: var(--teal); }
.score-cell { display: flex; align-items: center; gap: 8px; }
.score-ring { --score: 0; width: 44px; height: 44px; display: grid; place-items: center; border: 5px solid #e5e9ee; border-top-color: var(--blue); border-right-color: var(--blue); border-radius: 50%; font-family: "Segoe UI", sans-serif; font-size: 12px; font-weight: 800; transform: rotate(calc((var(--score) - 50) * 0.25deg)); }
.score-ring span { transform: rotate(calc((var(--score) - 50) * -0.25deg)); }
.score-0 { --score: 0; }
.score-10 { --score: 10; }
.score-20 { --score: 20; }
.score-30 { --score: 30; }
.score-40 { --score: 40; }
.score-50 { --score: 50; }
.score-60 { --score: 60; }
.score-70 { --score: 70; }
.score-80 { --score: 80; }
.score-90 { --score: 90; }
.score-100 { --score: 100; }
.score-label { color: var(--muted); font-size: 10px; line-height: 1.35; }
.row-actions { display: flex; justify-content: flex-end; gap: 6px; }
.row-actions .icon-button { width: 32px; height: 32px; font-size: 16px; text-decoration: none; }
.save-button.active { color: var(--blue); border-color: #aab9dc; background: var(--blue-soft); }

.empty-state { min-height: 320px; display: grid; place-items: center; text-align: center; color: var(--muted); }
.empty-state strong { display: block; margin-bottom: 7px; color: var(--ink); font-size: 16px; }
.skeleton-row { height: 106px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, #f5f6f7 20%, #eceff2 40%, #f5f6f7 60%); background-size: 220% 100%; animation: shimmer 1.2s infinite; }
.load-more { width: 100%; height: 42px; margin-top: 12px; border: 1px solid var(--line-strong); border-radius: 5px; background: #fff; color: var(--ink); font-weight: 700; }

.drawer-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(23, 25, 29, 0.34); }
.detail-drawer { position: fixed; top: 0; right: 0; z-index: 60; width: min(520px, 94vw); height: 100vh; display: flex; flex-direction: column; background: var(--paper); box-shadow: var(--shadow); transform: translateX(102%); transition: transform 220ms ease; }
.detail-drawer.open { transform: translateX(0); }
.drawer-head { height: 62px; flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid var(--line); }
.drawer-kicker { color: var(--muted); font-size: 11px; font-weight: 800; }
.drawer-content { padding: 22px 24px 50px; overflow-y: auto; }
.drawer-image { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; margin: 0 0 18px; border-radius: 5px; background: #e7ebef; }
.drawer-title { margin: 0; font-size: 22px; line-height: 1.55; }
.drawer-lead { margin: 14px 0; color: #535b66; font-size: 13px; line-height: 1.8; }
.drawer-statline { display: grid; grid-template-columns: repeat(4, 1fr); margin: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.drawer-stat { padding: 14px 10px; border-right: 1px solid var(--line); }
.drawer-stat:last-child { border-right: 0; }
.drawer-stat b { display: block; font-family: "Segoe UI", sans-serif; font-size: 20px; }
.drawer-stat span { display: block; margin-top: 4px; color: var(--muted); font-size: 10px; }
.drawer-actions { display: flex; flex-wrap: wrap; gap: 7px; margin: 18px 0; }
.drawer-actions .button { flex: 1 1 100px; }
.body-copy { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.body-copy h2 { margin: 0 0 12px; font-size: 14px; }
.body-copy p { margin: 0 0 15px; color: #353a42; font-family: "SimSun", "Songti SC", serif; font-size: 15px; line-height: 1.9; }
.risk-note { margin: 14px 0; padding: 11px 12px; border-left: 3px solid var(--amber); background: var(--amber-soft); color: #754500; font-size: 12px; line-height: 1.6; }
.risk-note.high { border-color: var(--red); background: var(--red-soft); color: #8e2030; }
.source-link { display: inline-flex; align-items: center; gap: 5px; color: var(--blue); font-size: 12px; text-decoration: none; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 80; min-width: 220px; max-width: min(480px, 90vw); padding: 12px 16px; border-radius: 5px; background: var(--ink); color: #fff; box-shadow: var(--shadow); font-size: 13px; text-align: center; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; transition: 180ms ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.error { background: #9e2133; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: 0.35; } }
@keyframes shimmer { to { background-position: -120% 0; } }

@media (max-width: 1000px) {
  .metric-band { grid-template-columns: repeat(6, 1fr); }
  .metric-time { display: none; }
  .workspace { grid-template-columns: 210px minmax(0, 1fr); }
  .feed-panel { padding-left: 16px; padding-right: 16px; }
  .article-row, .feed-head { grid-template-columns: 82px minmax(0, 1fr) 76px; }
  .article-row > .row-actions, .feed-head span:last-child { display: none; }
  .score-label { display: none; }
}

@media (max-width: 760px) {
  .app-header { height: auto; min-height: 64px; padding: 10px 14px; }
  .brand-subtitle, .sync-state { display: none; }
  .header-actions { gap: 6px; }
  .button { padding: 0 10px; }
  .button.secondary span:last-child { display: none; }
  .metric-band { grid-template-columns: repeat(3, 1fr); min-height: 68px; padding: 0 10px; overflow: hidden; }
  .metric { padding: 17px 6px 14px; border-right: 0; }
  .metric:first-child { border-left: 0; }
  .metric:nth-child(4), .metric:nth-child(5), .metric:nth-child(6) { display: none; }
  .metric-value { font-size: 23px; }
  .metric-label { font-size: 10px; }
  .workspace { display: block; min-height: 0; }
  .filter-rail { position: fixed; left: 0; top: 0; bottom: 0; z-index: 70; width: min(300px, 88vw); padding-top: 84px; transform: translateX(-102%); transition: transform 180ms ease; overflow-y: auto; box-shadow: var(--shadow); }
  .filter-rail.open { transform: translateX(0); }
  .feed-panel { padding: 16px 10px 36px; }
  .mobile-filter-button { display: inline-grid; }
  .feed-head { display: none; }
  .article-row { grid-template-columns: 62px minmax(0, 1fr); gap: 10px; min-height: 118px; padding: 14px 8px 14px 13px; }
  .article-row > .score-cell { display: none; }
  .comment-number { font-size: 22px; }
  .article-title { font-size: 14px; }
  .article-main.has-image { grid-template-columns: 64px minmax(0, 1fr); gap: 9px; }
  .article-thumb { width: 64px; height: 48px; }
  .article-meta { gap: 5px 9px; }
  .cluster-strip { align-items: flex-start; flex-direction: column; gap: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
