:root {
  --canvas: #f4f7f2;
  --surface: #ffffff;
  --surface-soft: #edf2ee;
  --ink: #17241f;
  --muted: #64726b;
  --line: #d9e1dc;
  --green: #0f6b55;
  --green-soft: #dcece5;
  --coral: #c94f35;
  --blue: #2f668d;
  --gold: #b27a19;
  --shadow: 0 18px 42px rgba(31, 58, 46, 0.1);
  --topbar-height: 68px;
  --mobile-nav-height: 66px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color: var(--ink);
  font-family: "Microsoft YaHei UI", "Noto Sans SC", sans-serif;
  font-synthesis: none;
  letter-spacing: 0;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background-color: var(--canvas);
  background-image:
    linear-gradient(rgba(24, 74, 55, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 74, 55, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
}
button, input, select { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
[hidden] { display: none !important; }

.login-view {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) minmax(320px, 1.15fr);
  background: var(--surface);
}
.login-mark {
  position: relative;
  overflow: hidden;
  display: grid;
  place-content: center;
  gap: 18px;
  background:
    linear-gradient(150deg, rgba(255,255,255,.08), transparent 45%),
    var(--green);
}
.login-mark::before,
.login-mark::after {
  content: "";
  position: absolute;
  width: 68%;
  aspect-ratio: 1;
  border: 1px solid rgba(255,255,255,.18);
  transform: rotate(22deg);
}
.login-mark::before { left: -18%; top: -22%; }
.login-mark::after { right: -20%; bottom: -28%; }
.login-mark span,
.brand-mark span {
  display: block;
  background: currentColor;
}
.login-mark span { width: 128px; height: 18px; color: white; }
.login-mark span:nth-child(2) { width: 82px; margin-left: 46px; background: #f0c35a; }
.login-mark span:nth-child(3) { width: 46px; margin-left: 82px; background: #e26f55; }
.login-panel {
  width: min(430px, calc(100% - 48px));
  margin: auto;
  display: grid;
  gap: 22px;
}
.eyebrow { margin: 0; color: var(--green); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.login-panel h1,
.feed-toolbar h1,
.dialog-head h2 {
  margin: 0;
  font-family: "STZhongsong", "Songti SC", serif;
  font-weight: 700;
  letter-spacing: 0;
}
.login-panel h1 { font-size: clamp(32px, 5vw, 52px); }
.login-panel label,
.source-form label,
.dingtalk-form label { display: grid; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 700; }
input,
select {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 13px;
  color: var(--ink);
  background: white;
  outline: none;
}
input:focus,
select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(15,107,85,.12); }
.check-row {
  width: fit-content;
  grid-template-columns: 18px 1fr;
  align-items: center;
  column-gap: 12px;
  row-gap: 0;
}
.check-row input {
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  accent-color: var(--green);
}
.primary-command {
  min-height: 46px;
  border: 0;
  border-radius: 6px;
  padding: 0 17px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: white;
  background: var(--green);
  cursor: pointer;
  font-weight: 800;
}
.primary-command:hover { background: #0b5946; }
.primary-command.compact { min-height: 40px; justify-content: center; align-self: end; }
.secondary-command {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--green);
  background: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}
.secondary-command:hover { border-color: var(--green); background: var(--green-soft); }
.secondary-command svg { width: 16px; height: 16px; }
.form-status { min-height: 20px; margin: 0; color: var(--coral); font-size: 13px; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 228px minmax(480px, 1fr) 238px;
  grid-template-rows: var(--topbar-height) 1fr;
  grid-template-areas: "top top top" "left main right";
}
.topbar {
  grid-area: top;
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(250,252,249,.94);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.brand > span:last-child { display: grid; gap: 1px; }
.brand strong { font-family: "STZhongsong", "Songti SC", serif; font-size: 20px; }
.brand small { color: var(--muted); font-size: 10px; }
.brand-mark { width: 29px; height: 29px; display: grid; align-content: center; gap: 3px; color: var(--green); }
.brand-mark span { height: 4px; }
.brand-mark span:nth-child(2) { width: 68%; margin-left: 32%; color: var(--gold); }
.brand-mark span:nth-child(3) { width: 38%; margin-left: 62%; color: var(--coral); }
.top-actions { display: flex; align-items: center; gap: 7px; }
.service-menu-button {
  min-height: 36px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--green);
  background: var(--green-soft);
  cursor: pointer;
  font-weight: 800;
}
.service-menu-button:hover,
.service-menu-button[aria-expanded="true"] { color: white; background: var(--green); border-color: var(--green); }
.service-menu-button svg { width: 17px; height: 17px; }
.service-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 20px;
  z-index: 60;
  width: min(380px, calc(100vw - 32px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.service-menu-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding: 4px 4px 11px; border-bottom: 1px solid var(--line); }
.service-menu-head strong { display: block; margin-top: 3px; font-family: "STZhongsong", "Songti SC", serif; font-size: 19px; }
.service-menu-head small { color: var(--muted); font-size: 10px; }
.service-list { display: grid; gap: 7px; padding-top: 9px; }
.sync-state { margin-right: 6px; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.sync-state > span { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.sync-state.is-ok > span { background: var(--green); }
.sync-state.is-busy > span { background: var(--blue); animation: pulse 1s infinite alternate; }
.icon-button,
.section-label button,
.article-action,
.source-action {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
}
.icon-button:hover,
.article-action:hover,
.source-action:hover { border-color: var(--green); color: var(--green); }
.icon-button svg,
.article-action svg,
.source-action svg,
.section-label button svg { width: 17px; height: 17px; }
.icon-button.is-spinning svg { animation: spin .8s linear infinite; }

.left-rail,
.right-rail { position: sticky; top: var(--topbar-height); height: calc(100vh - var(--topbar-height)); overflow-y: auto; }
.left-rail { grid-area: left; padding: 20px 14px; border-right: 1px solid var(--line); background: rgba(244,247,242,.84); }
.right-rail { grid-area: right; padding: 20px 16px; border-left: 1px solid var(--line); }
.filter-nav { display: grid; gap: 4px; }
.workspace-nav { display: grid; gap: 3px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.workspace-button {
  min-height: 42px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  color: var(--muted);
  background: transparent;
  appearance: none;
  text-align: left;
  cursor: pointer;
}
.workspace-button svg { width: 17px; height: 17px; }
.workspace-button:hover { color: var(--ink); background: var(--surface-soft); }
.workspace-button.is-active { color: white; background: var(--green); font-weight: 800; }
.filter-button {
  min-height: 42px;
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: var(--muted);
}
.filter-button svg { width: 17px; height: 17px; }
.filter-button strong { min-width: 24px; color: inherit; text-align: right; font-size: 12px; }
.filter-button:hover { background: var(--surface-soft); color: var(--ink); }
.filter-button.is-active { color: var(--green); background: var(--green-soft); font-weight: 800; }
.rail-section { margin-top: 26px; }
.section-label { margin: 0 4px 10px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.section-label button { width: 28px; height: 28px; border: 0; background: transparent; }
.source-nav { display: grid; gap: 2px; }
.source-nav button {
  min-height: 36px;
  border: 0;
  border-radius: 5px;
  padding: 0 9px;
  display: grid;
  grid-template-columns: 8px 1fr auto;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.source-nav button:hover,
.source-nav button.is-active { color: var(--ink); background: var(--surface); }
.source-dot { width: 7px; height: 7px; border-radius: 2px; background: var(--source-color, var(--green)); }
.source-nav small { font-size: 10px; }
.service-link {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 62px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--canvas);
  color: var(--ink);
  text-decoration: none;
}
.service-link:hover { border-color: var(--green); background: var(--green-soft); }
.service-link > span:first-child { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 5px; color: white; background: var(--blue); }
.service-link svg { width: 19px; height: 19px; }
.service-link strong { display: block; font-size: 13px; }
.service-link small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.service-empty { margin: 0; padding: 16px 10px; color: var(--muted); font-size: 12px; text-align: center; }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: #9ba7a1; }
.online-dot.is-online { background: #18a574; box-shadow: 0 0 0 3px rgba(24,165,116,.13); }

.service-transition {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 24px;
  color: var(--ink);
  background:
    linear-gradient(rgba(24, 74, 55, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 74, 55, .035) 1px, transparent 1px),
    rgba(244, 247, 242, .97);
  background-size: 28px 28px;
  opacity: 0;
  transition: opacity .18s ease;
}
.service-transition.is-active { opacity: 1; }
.service-transition-track { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.service-transition-workbench,
.service-transition-codex {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: white;
  background: var(--green);
  font-family: "STZhongsong", "Songti SC", serif;
  font-size: 17px;
  font-weight: 800;
}
.service-transition-codex { background: var(--blue); font-family: Georgia, serif; font-size: 24px; }
.service-transition-line { position: relative; width: 82px; height: 2px; overflow: hidden; background: var(--line); }
.service-transition-line i { position: absolute; inset: 0; background: var(--coral); transform: translateX(-105%); animation: service-transfer .72s ease-in-out infinite; }
.service-transition strong { font-family: "STZhongsong", "Songti SC", serif; font-size: 22px; }
.service-transition small { color: var(--muted); font-size: 12px; }

.feed-main { grid-area: main; min-width: 0; padding: 30px clamp(20px, 4vw, 58px) 80px; }
.workspace-view { min-width: 0; animation: view-in .28s ease both; }
.news-mobile-filters { display: none; }
.note-category-filters { display: none; }
.feed-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.feed-toolbar > div { min-width: 180px; }
.feed-toolbar h1 { margin-top: 5px; font-size: 30px; }
.search-box {
  width: min(410px, 48%);
  min-height: 42px;
  display: grid;
  grid-template-columns: 22px 1fr 30px;
  align-items: center;
  gap: 5px;
  border-bottom: 1px solid var(--line);
}
.search-box:focus-within { border-color: var(--green); }
.search-box svg { width: 17px; color: var(--muted); }
.search-box input { border: 0; padding: 8px 0; background: transparent; box-shadow: none; }
.search-box button { border: 0; background: transparent; cursor: pointer; color: var(--muted); }
.feed-meta { margin: 18px 0 10px; padding-bottom: 10px; display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.topic-filters {
  margin: 0 0 22px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.topic-filters::-webkit-scrollbar { display: none; }
.topic-filters button {
  min-height: 34px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  background: rgba(255,255,255,.72);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}
.topic-filters button:hover,
.topic-filters button.is-active { border-color: var(--green); color: var(--ink); background: var(--green-soft); }
.topic-swatch { width: 8px; height: 8px; border-radius: 2px; background: var(--green); }
.topic-swatch.is-image { background: var(--blue); }
.topic-swatch.is-deep { background: var(--coral); }
.topic-swatch.is-industrial { background: var(--gold); }
.article-list { display: grid; }
.article-row {
  position: relative;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  gap: 15px;
  padding: 19px 0;
  border-bottom: 1px solid var(--line);
  animation: row-in .36s ease both;
}
.article-row.is-read { opacity: .68; }
.article-signal { width: 8px; height: 52px; border-radius: 2px; background: var(--source-color, var(--green)); }
.article-copy { min-width: 0; }
.article-kicker { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.article-kicker time { font-weight: 500; }
.article-topic { padding: 2px 5px; border-radius: 4px; color: var(--topic-color, var(--green)); background: color-mix(in srgb, var(--topic-color, var(--green)) 12%, white); font-style: normal; }
.translation-mark { padding: 2px 5px; border-radius: 4px; color: var(--green); background: var(--green-soft); font-style: normal; font-weight: 800; }
.article-copy h2 { margin: 7px 0 7px; font-size: 17px; line-height: 1.48; }
.article-copy h2 a { color: var(--ink); text-decoration: none; }
.article-copy h2 a:hover { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.article-copy p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.72; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-actions { display: grid; grid-template-columns: repeat(3, 36px); align-content: center; gap: 6px; }
.article-action.is-active { color: var(--coral); border-color: rgba(201,79,53,.35); background: #fff5f2; }
.article-action.is-exported { color: var(--green); border-color: rgba(15,107,85,.35); background: var(--green-soft); }
.translation-action { color: var(--blue); }
.translation-action:hover { border-color: var(--blue); color: var(--blue); }
.translation-action.is-translating svg { animation: spin .8s linear infinite; }
.empty-state { min-height: 350px; display: grid; place-content: center; justify-items: center; gap: 9px; color: var(--muted); text-align: center; }
.empty-state svg { width: 36px; height: 36px; color: var(--green); }
.empty-state strong { color: var(--ink); }
.empty-state span { font-size: 12px; }

.overview-date { color: var(--muted); font-size: 12px; }
.overview-metrics {
  margin: 28px 0 40px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.overview-metrics button {
  min-width: 0;
  padding: 22px 18px;
  display: grid;
  gap: 7px;
  border: 0;
  border-right: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  appearance: none;
  text-align: left;
  cursor: pointer;
}
.overview-metrics button:last-child { border-right: 0; }
.overview-metrics button:hover { background: var(--surface-soft); }
.overview-metrics strong { color: var(--green); font-family: "STZhongsong", "Songti SC", serif; font-size: 36px; }
.overview-band { display: grid; grid-template-columns: minmax(150px, .36fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.overview-band h2 { margin: 6px 0 0; font-family: "STZhongsong", "Songti SC", serif; font-size: 24px; }
.overview-note-list { display: grid; border-top: 1px solid var(--line); }
.overview-note {
  min-width: 0;
  min-height: 62px;
  padding: 11px 8px;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  appearance: none;
  text-align: left;
  cursor: pointer;
}
.overview-note:hover { background: var(--surface-soft); }
.overview-note span { color: var(--green); font-size: 10px; font-weight: 800; }
.overview-note strong { min-width: 0; overflow-wrap: anywhere; font-size: 13px; }
.overview-note svg { width: 15px; color: var(--muted); }

.note-workspace { margin-top: 24px; display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: 28px; align-items: start; }
.note-list { min-width: 0; display: grid; border-top: 1px solid var(--line); }
.note-row {
  min-width: 0;
  padding: 14px 10px;
  display: grid;
  gap: 6px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-left: 3px solid transparent;
  color: var(--ink);
  background: transparent;
  appearance: none;
  text-align: left;
  cursor: pointer;
}
.note-row:hover { background: var(--surface-soft); }
.note-row.is-active { border-left-color: var(--green); background: var(--green-soft); }
.note-row span { color: var(--green); font-size: 10px; font-weight: 800; }
.note-row strong { overflow-wrap: anywhere; font-size: 13px; }
.note-row p { margin: 0; overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.note-detail { min-width: 0; min-height: 440px; padding-left: 28px; border-left: 1px solid var(--line); }
.note-detail header { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.note-detail header span { color: var(--green); font-size: 10px; font-weight: 800; }
.note-detail h2 { margin: 6px 0 0; overflow-wrap: anywhere; font-family: "STZhongsong", "Songti SC", serif; font-size: 26px; }
.note-body { padding: 10px 0 40px; overflow-wrap: anywhere; font-size: 13px; line-height: 1.82; }
.note-body h1 { display: none; }
.note-body h2, .note-body h3 { margin: 26px 0 8px; font-family: "STZhongsong", "Songti SC", serif; line-height: 1.4; }
.note-body a { color: var(--blue); text-underline-offset: 3px; }
.note-body pre { max-width: 100%; padding: 13px; overflow: auto; border: 1px solid var(--line); border-radius: 5px; background: #eef2ef; }
.note-body code { font-family: "Cascadia Code", Consolas, monospace; font-size: 12px; }
.note-body table { width: 100%; display: block; overflow-x: auto; border-collapse: collapse; }
.note-body th, .note-body td { padding: 7px 9px; border: 1px solid var(--line); white-space: nowrap; }
.note-placeholder, .note-empty { color: var(--muted); text-align: center; }
.note-placeholder { min-height: 320px; display: grid; place-content: center; justify-items: center; gap: 8px; }
.note-placeholder svg { width: 32px; color: var(--green); }
.note-placeholder strong { color: var(--ink); }
.note-placeholder span { font-size: 11px; }
.note-empty { padding: 38px 12px; border-bottom: 1px solid var(--line); font-size: 12px; }
.loading-line { width: 96px; height: 3px; overflow: hidden; background: var(--line); }
.loading-line::after { content: ""; display: block; width: 48%; height: 100%; background: var(--green); animation: loading-slide .8s ease-in-out infinite alternate; }

.pulse-panel { padding: 18px 0 22px; border-bottom: 1px solid var(--line); }
.pulse-number { margin: 14px 0 18px; display: flex; align-items: baseline; gap: 8px; }
.pulse-number strong { font-family: "STZhongsong", "Songti SC", serif; font-size: 52px; line-height: 1; color: var(--green); }
.pulse-number span { color: var(--muted); font-size: 12px; }
.pulse-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pulse-grid span { padding: 9px; border-left: 3px solid var(--line); color: var(--muted); font-size: 10px; }
.pulse-grid span:first-child { border-color: var(--coral); }
.pulse-grid span:last-child { border-color: var(--gold); }
.pulse-grid strong { display: block; color: var(--ink); font-size: 18px; }
.rhythm-panel { padding-top: 23px; }
.rhythm-panel ol { margin: 0; padding: 0; display: grid; gap: 14px; list-style: none; }
.rhythm-panel li { display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 9px; }
.rhythm-panel li > span { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--green); font-family: "STZhongsong", "Songti SC", serif; font-weight: 700; }
.rhythm-panel p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

.mobile-nav { display: none; }
.source-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.source-dialog::backdrop { background: rgba(18,35,28,.38); backdrop-filter: blur(3px); }
.dialog-head { padding: 20px 22px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin-top: 4px; font-size: 23px; }
.source-form { padding: 18px 22px 8px; display: grid; grid-template-columns: 1fr 1.6fr 120px 90px; gap: 12px; align-items: end; }
.source-dialog > .form-status { padding: 0 22px; }
.source-list { padding: 5px 22px 22px; display: grid; }
.source-item { min-height: 64px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.source-item strong { display: block; font-size: 13px; }
.source-item small { display: block; max-width: 440px; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.source-topic { padding: 3px 6px; border-radius: 4px; color: var(--green); background: var(--green-soft); font-size: 10px; font-weight: 800; }
.source-state { color: var(--muted); font-size: 10px; }
.source-state.has-error { color: var(--coral); }
.source-actions { display: flex; gap: 6px; }
.source-action.danger:hover { color: var(--coral); border-color: var(--coral); }
.dingtalk-dialog { width: min(760px, calc(100vw - 32px)); }
.dingtalk-form {
  padding: 18px 22px 8px;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, .9fr);
  gap: 12px;
  align-items: end;
}
.dingtalk-form .wide-field { grid-column: 1 / -1; }
.dingtalk-form .check-row { align-self: center; }
.dingtalk-panel { padding: 4px 22px 22px; display: grid; gap: 12px; }
.dingtalk-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.dingtalk-status p {
  margin: 0;
  min-height: 58px;
  padding: 10px;
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}
.dingtalk-status strong { font-size: 12px; }
.dingtalk-status span { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.dingtalk-status .has-error { border-color: rgba(201,79,53,.4); background: rgba(201,79,53,.08); }
.dingtalk-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dingtalk-preview {
  min-height: 120px;
  max-height: 280px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  background: #fbfcfa;
  font: 12px/1.6 "Microsoft YaHei UI", "Noto Sans SC", sans-serif;
  white-space: pre-wrap;
}
.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 50; display: grid; gap: 8px; }
.toast { width: min(340px, calc(100vw - 36px)); padding: 12px 14px; border-left: 4px solid var(--green); border-radius: 5px; color: white; background: #20342b; box-shadow: var(--shadow); font-size: 12px; animation: toast-in .25s ease both; }
.toast.is-error { border-color: var(--coral); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { to { opacity: .35; } }
@keyframes row-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes view-in { from { opacity: 0; transform: translateY(5px); } }
@keyframes loading-slide { to { transform: translateX(110%); } }
@keyframes service-transfer { 55%, 100% { transform: translateX(105%); } }

@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 210px minmax(440px, 1fr); grid-template-areas: "top top" "left main"; }
  .right-rail { display: none; }
  .note-workspace { grid-template-columns: minmax(210px, 270px) minmax(0, 1fr); }
}

@media (max-width: 760px) {
  :root { --topbar-height: 60px; }
  .login-view {
    min-height: 100dvh;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(120px, 22dvh) auto;
    align-content: start;
    overflow-y: auto;
  }
  .login-mark { min-height: 120px; }
  .login-mark span { width: 86px; height: 12px; }
  .login-panel {
    width: min(430px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 calc(32px + var(--safe-bottom));
    align-self: start;
    gap: 16px;
  }
  .login-panel h1 { font-size: 32px; }
  .app-shell { display: block; padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom)); }
  .topbar {
    min-height: calc(var(--topbar-height) + var(--safe-top));
    padding: var(--safe-top) 12px 0;
  }
  .service-menu {
    right: 12px;
    max-height: calc(100dvh - var(--topbar-height) - var(--safe-top) - 16px);
    overflow-y: auto;
  }
  .brand small, .sync-state, #logoutButton { display: none; }
  .left-rail, .right-rail { display: none; }
  .feed-main { padding: 22px 16px 40px; }
  .feed-toolbar { display: grid; gap: 16px; }
  .feed-toolbar h1 { font-size: 26px; }
  .search-box { width: 100%; }
  .news-mobile-filters {
    margin-bottom: 18px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
  }
  .note-category-filters {
    margin: 16px 0 18px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 1px solid var(--line);
    border-radius: 6px;
    overflow: hidden;
  }
  .note-category-filters button {
    min-height: 38px;
    border: 0;
    border-right: 1px solid var(--line);
    color: var(--muted);
    background: var(--surface);
  }
  .note-category-filters button:last-child { border-right: 0; }
  .note-category-filters button.is-active { color: white; background: var(--green); font-weight: 800; }
  .news-mobile-filters button {
    min-height: 38px;
    border: 0;
    border-right: 1px solid var(--line);
    color: var(--muted);
    background: var(--surface);
    appearance: none;
  }
  .news-mobile-filters button:last-child { border-right: 0; }
  .news-mobile-filters button.is-active { color: white; background: var(--green); font-weight: 800; }
  .topic-filters { margin: -4px -2px 18px; padding: 0 2px 2px; }
  .overview-metrics { margin: 20px 0 30px; }
  .overview-metrics button { padding: 16px 9px; }
  .overview-metrics strong { font-size: 28px; }
  .overview-band { grid-template-columns: 1fr; gap: 16px; }
  .overview-note { grid-template-columns: 54px minmax(0, 1fr) 18px; }
  .note-workspace { grid-template-columns: 1fr; gap: 20px; }
  .note-detail { min-height: 360px; padding: 20px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .note-detail h2 { font-size: 23px; }
  .article-row { grid-template-columns: 7px minmax(0, 1fr); gap: 11px; padding: 17px 0; }
  .article-signal { width: 6px; height: 46px; }
  .article-copy h2 { font-size: 15px; }
  .article-copy p { -webkit-line-clamp: 3; }
  .article-actions { grid-column: 2; display: flex; justify-content: flex-end; margin-top: 4px; }
  .article-action { width: 34px; height: 34px; }
  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    height: calc(var(--mobile-nav-height) + var(--safe-bottom));
    padding: 6px 8px var(--safe-bottom);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--line);
    background: rgba(250,252,249,.96);
    backdrop-filter: blur(16px);
  }
  .mobile-nav button { border: 0; background: transparent; display: grid; place-content: center; justify-items: center; gap: 3px; color: var(--muted); font-size: 10px; }
  .mobile-nav button svg { width: 19px; height: 19px; }
  .mobile-nav button.is-active { color: var(--green); font-weight: 800; }
  .source-form { grid-template-columns: 1fr; }
  .dingtalk-form,
  .dingtalk-status { grid-template-columns: 1fr; }
  .dingtalk-form .wide-field { grid-column: auto; }
  .source-item { grid-template-columns: 1fr auto; padding: 10px 0; }
  .source-topic, .source-state { grid-column: 1; justify-self: start; }
  .source-actions { grid-column: 2; grid-row: 1 / span 3; }
  .source-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 20px);
  }
  .source-list { padding-bottom: calc(22px + var(--safe-bottom)); }
}

@media (max-width: 360px) {
  .topbar { padding-right: 10px; padding-left: 10px; }
  .brand { gap: 8px; }
  .brand strong { font-size: 18px; }
  .top-actions { gap: 5px; }
  .service-menu-button { padding: 0 9px; }
  .feed-main { padding-right: 14px; padding-left: 14px; }
  .overview-metrics button { padding-right: 6px; padding-left: 6px; }
  .overview-metrics button span { font-size: 11px; }
}

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