:root {
  color-scheme: light;
  --bg: #e9f1f0;
  --panel: #ffffff;
  --panel-muted: #f3f8f7;
  --ink: #111c22;
  --muted: #64727c;
  --line: rgba(178, 203, 202, 0.72);
  --line-strong: #a9c7c7;
  --accent: #08979d;
  --accent-strong: #056d72;
  --accent-soft: #dff4f2;
  --cyan: #48c7ca;
  --gold: #d6b25e;
  --hero: #092e30;
  --hero-soft: #155a5d;
  --green-bg: #dff3ea;
  --green-ink: #15653e;
  --amber-bg: #fff0c7;
  --amber-ink: #775700;
  --blue-bg: #dbeeff;
  --blue-ink: #1d5d89;
  --red-bg: #ffe4de;
  --red-ink: #963d2b;
  --gray-bg: #e8ebee;
  --gray-ink: #4b5661;
  --shadow: 0 18px 44px rgba(12, 31, 35, 0.1);
  --shadow-soft: 0 8px 20px rgba(12, 31, 35, 0.06);
  --shadow-lift: 0 22px 56px rgba(8, 45, 48, 0.12);
  --font-sans: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Source Han Sans SC", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #fbfcfc 0, #eef4f3 380px, #f8faf9 100%);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(8, 109, 114, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(8, 109, 114, 0.022) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, #000 0, rgba(0, 0, 0, 0.58) 420px, transparent 100%);
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(15, 133, 136, 0.22);
  outline-offset: 2px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(230px, 290px) minmax(320px, 1fr) auto;
  gap: 20px;
  align-items: center;
  min-height: 92px;
  padding: 16px 30px;
  background:
    linear-gradient(90deg, rgba(8, 45, 48, 0.98), rgba(10, 61, 64, 0.94) 48%, rgba(247, 251, 250, 0.9));
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 42px rgba(8, 45, 48, 0.16);
  backdrop-filter: blur(18px) saturate(150%);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(3, 8px);
  align-items: end;
  gap: 4px;
  width: 46px;
  height: 46px;
  padding: 9px;
  background: linear-gradient(145deg, rgba(224, 250, 247, 0.96), rgba(255, 255, 255, 0.72));
  border: 0;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(72, 199, 202, 0.34), 0 12px 30px rgba(72, 199, 202, 0.18);
}

.brand-mark span {
  display: block;
  width: 8px;
  background: linear-gradient(180deg, #32b8b5, var(--accent-strong));
  border-radius: 2px 2px 0 0;
}

.brand-mark span:nth-child(1) {
  height: 10px;
}

.brand-mark span:nth-child(2) {
  height: 16px;
}

.brand-mark span:nth-child(3) {
  height: 22px;
}

.brand-block h1,
.section-heading h2,
.news-card h3,
.source-card h3,
.compare-card h3 {
  margin: 0;
  line-height: 1.18;
}

.brand-block h1 {
  color: #fff;
  font-size: 24px;
  font-weight: 800;
}

.eyebrow,
.card-kicker {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.topbar .eyebrow,
.topbar label {
  color: rgba(255, 255, 255, 0.68);
}

.topbar input {
  color: #f7ffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.topbar input::placeholder {
  color: rgba(255, 255, 255, 0.56);
}

.topbar input:focus {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(72, 199, 202, 0.9);
  box-shadow: 0 0 0 3px rgba(72, 199, 202, 0.22);
}

.global-search {
  display: grid;
  gap: 6px;
  min-width: 0;
}

label {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  margin-top: 6px;
  padding: 9px 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(178, 203, 202, 0.68);
  border-radius: 8px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15, 133, 136, 0.14);
}

.view-tabs {
  display: grid;
  grid-template-columns: repeat(4, 76px);
  gap: 10px;
}

.tab-button,
.card-actions button,
.primary-button,
.secondary-button,
.link-button {
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.tab-button {
  border-color: rgba(8, 109, 114, 0.18);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 24px rgba(8, 45, 48, 0.06);
}

.card-actions button,
.secondary-button,
.link-button {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(246, 250, 249, 0.9));
  box-shadow: 0 8px 18px rgba(8, 45, 48, 0.05);
}

.tab-button.is-active,
.primary-button {
  border-color: var(--accent);
  background: linear-gradient(135deg, #18afb4, var(--accent-strong));
  color: #fff;
  box-shadow: 0 14px 28px rgba(8, 109, 114, 0.26);
}

.secondary-button {
  background: var(--panel-muted);
}

.primary-button:hover {
  background: linear-gradient(135deg, #1fc0c4, #06767b);
}

.tab-button:hover,
.card-actions button:hover,
.link-button:hover,
.secondary-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  max-width: 1500px;
  min-height: calc(100vh - 92px);
  margin: 0 auto;
  padding: 24px 28px 36px;
}

body[data-view="devices"] .workspace {
  grid-template-columns: minmax(0, 1fr);
}

.content-pane {
  min-width: 0;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px) saturate(130%);
}

.content-pane {
  min-height: 620px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(250, 253, 252, 0.82)),
    linear-gradient(135deg, rgba(72, 199, 202, 0.1), transparent 42%);
  border-color: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow-lift);
}

.app-view {
  display: none;
  padding: 22px;
}

.app-view.is-visible {
  display: block;
}

.section-heading {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.section-heading::before {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 120px;
  height: 2px;
  content: "";
  background: linear-gradient(90deg, var(--accent), var(--gold));
}

.section-heading h2 {
  font-size: 26px;
  font-weight: 760;
}

.counter-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.counter-strip span {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  min-height: 32px;
  padding: 7px 10px;
  color: var(--muted);
  background: #f7faf9;
  border: 1px solid #e7eeee;
  border-radius: 6px;
  font-size: 12px;
  box-shadow: 0 8px 18px rgba(8, 45, 48, 0.05);
}

.counter-strip strong {
  color: var(--ink);
  font-size: 15px;
}

.news-list {
  display: grid;
  gap: 14px;
}

.daily-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  min-height: 0;
  padding: 20px 22px;
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff, #f7fbfa);
  border-radius: 8px;
  border: 1px solid #dbe8e7;
  box-shadow: 0 10px 30px rgba(12, 31, 35, 0.07);
}

.daily-hero::before {
  display: none;
}

.daily-hero::after {
  display: none;
}

.daily-hero-main {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: center;
  min-width: 0;
}

.daily-hero .eyebrow {
  color: var(--accent-strong);
}

.daily-hero h2 {
  margin: 0;
  font-size: 28px;
  font-weight: 650;
  line-height: 1.22;
}

.daily-intro {
  max-width: 760px;
  margin: 8px 0 0;
  color: #485760;
  line-height: 1.72;
  font-size: 14.5px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(72px, 1fr));
  gap: 8px;
  max-width: 520px;
  margin-top: 14px;
}

.hero-stats span {
  display: grid;
  gap: 2px;
  min-height: 52px;
  padding: 9px 11px;
  background: #f5faf9;
  border: 1px solid #dceceb;
  border-radius: 7px;
  color: #60717a;
  font-size: 12px;
}

.hero-stats strong {
  color: var(--ink);
  font-size: 21px;
  line-height: 1;
}

.daily-meta {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 7px 10px;
  min-width: 330px;
  max-width: 380px;
  padding: 10px 12px;
  background: #f7fbfa;
  border: 1px solid #dceceb;
  border-radius: 8px;
}

.daily-meta span,
.daily-meta small {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  color: #60717a;
  font-size: 11.5px;
}

.daily-meta strong {
  flex-basis: 100%;
  color: var(--ink);
  font-size: 20px;
  text-align: right;
}

.daily-meta .notify-button {
  margin-top: 0;
}

#notifyStatus {
  flex-basis: 100%;
  justify-content: flex-end;
}

.last-refresh-time {
  white-space: nowrap;
}

.notify-button {
  min-height: 34px;
  margin-top: 4px;
  padding: 8px 12px;
  color: #fff;
  background: rgba(15, 133, 136, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.notify-button.is-enabled {
  background: #fff;
  color: var(--accent-strong);
}

.notify-button:hover {
  background: rgba(31, 192, 196, 0.9);
}

.digest-list {
  display: grid;
  gap: 14px;
  margin-top: 0;
}

.digest-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  max-width: 980px;
  margin: 18px auto 0;
}

.digest-column {
  min-width: 0;
}

.digest-column-full {
  width: 100%;
}

.digest-column-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
  min-height: 58px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.digest-column-head h3 {
  margin: 2px 0 0;
  font-size: 20px;
  font-weight: 650;
  line-height: 1.22;
}

.digest-column-head > span {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 6px 10px;
  color: var(--accent-strong);
  background: #f3faf9;
  border: 1px solid #d8eceb;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 750;
}

.digest-column-head strong {
  color: var(--ink);
}

.priority-timeline {
  display: grid;
  gap: 22px;
}

.priority-day {
  display: grid;
  gap: 10px;
}

.priority-day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px 10px;
  border-bottom: 1px solid var(--line);
}

.priority-day-date {
  color: #26343d;
  font-size: 15px;
  font-weight: 650;
}

.priority-day-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.priority-day-items {
  position: relative;
  display: grid;
  gap: 0;
}

.priority-day-items::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 70px;
  width: 1px;
  content: "";
  background: #d6e4e3;
}

.priority-item {
  display: grid;
  grid-template-columns: 56px 28px minmax(0, 1fr);
  align-items: start;
  min-width: 0;
  padding-bottom: 12px;
}

.priority-item:last-child {
  padding-bottom: 0;
}

.priority-rank {
  padding-top: 18px;
  padding-right: 10px;
  color: #6c7a82;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.priority-rail {
  position: relative;
  min-height: 100%;
}

.priority-dot {
  position: absolute;
  top: 20px;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  border: 1px solid #f8fbfa;
  box-shadow: 0 0 0 2px #cfe4e2;
  transform: translateX(-50%);
}

.priority-item[data-level="必看"] .priority-rank {
  color: var(--accent-strong);
}

.priority-item[data-level="必看"] .priority-dot {
  background: #07878d;
  box-shadow: 0 0 0 3px rgba(8, 151, 157, 0.18);
}

.digest-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #dbe7e6;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(12, 31, 35, 0.045);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.digest-card:hover {
  background: linear-gradient(180deg, #fff, #f9fcfb);
  border-color: rgba(8, 151, 157, 0.34);
  box-shadow: 0 12px 28px rgba(8, 45, 48, 0.075);
}

.digest-card.is-read {
  background: #f8fbfb;
  border-color: #e2eeee;
}

.digest-card.is-read h3 {
  color: #52636b;
}

.digest-card-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 15px 16px 16px;
  cursor: pointer;
  list-style: none;
}

.digest-card-summary::-webkit-details-marker {
  display: none;
}

.digest-summary-main {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.digest-preview {
  margin: 0;
  color: #384953;
  font-size: 15px;
  line-height: 1.76;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.digest-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.digest-card-head .card-kicker {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.priority-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.priority-reasons span {
  min-height: 22px;
  padding: 3px 7px;
  color: var(--accent-strong);
  background: #edf8f7;
  border: 1px solid #d7eceb;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
}

.priority-reason-text {
  margin: 4px 0 0;
  padding: 8px 10px;
  color: #43515a;
  background: #fbfdfc;
  border: 1px solid #e7efee;
  border-left: 3px solid #b9dddd;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.72;
}

.priority-reason-text strong {
  color: var(--accent-strong);
  font-weight: 650;
}

.expand-hint {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 5px 9px;
  color: #52636b;
  background: #f7faf9;
  border: 1px solid #d8eceb;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

details[open] > summary .expand-hint {
  color: #fff;
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  font-size: 0;
}

details[open] > summary .expand-hint::after {
  content: "收起";
  font-size: 12px;
}

.digest-card[open] .digest-card-grid {
  margin: 0 16px 16px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.digest-card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.digest-card.has-media .digest-card-grid {
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: start;
}

.digest-media {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 4 / 3;
  padding: 0;
  background:
    linear-gradient(135deg, rgba(8, 109, 114, 0.08), transparent),
    #e9f2f1;
  border-radius: 8px;
  border: 1px solid rgba(180, 211, 210, 0.82);
  box-shadow: 0 10px 22px rgba(8, 45, 48, 0.09);
}

.digest-media::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.2), transparent 28%),
    linear-gradient(180deg, transparent 62%, rgba(0, 0, 0, 0.1));
}

.digest-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.04) contrast(1.02);
  transition: transform 0.25s ease;
}

.digest-card:hover .digest-media img {
  transform: scale(1.035);
}

.digest-card-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.digest-line {
  margin: 0;
  color: #2b3942;
  font-size: 15.5px;
  line-height: 1.82;
  max-width: 82ch;
}

.digest-points {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 0;
}

.digest-points span {
  min-height: 29px;
  padding: 6px 10px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 1px solid #d4e9e8;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 700;
}

.digest-confidence {
  margin: 0;
  padding: 10px 12px;
  color: #59646d;
  background: #f7faf9;
  border-left: 3px solid #cfe4e2;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.6;
}

.original-title {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.original-note {
  display: grid;
  gap: 7px;
  padding: 10px 11px;
  color: var(--muted);
  background: #f7faf9;
  border: 1px solid #e4eeee;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.62;
}

.original-note p {
  margin: 0;
}

.original-note strong {
  display: inline-flex;
  margin-right: 7px;
  color: var(--accent-strong);
}

.digest-reason {
  display: grid;
  gap: 7px;
  margin-top: 13px;
  padding: 11px 12px;
  color: #394651;
  background: #f7fafb;
  border: 1px solid #e7eeee;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.45;
}

.news-card,
.source-card,
.compare-card {
  position: relative;
  overflow: hidden;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 253, 252, 0.92)),
    linear-gradient(135deg, rgba(72, 199, 202, 0.08), transparent);
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.news-card::before,
.source-card::before,
.compare-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  content: "";
  background: linear-gradient(180deg, var(--accent), transparent);
  opacity: 0.7;
}

.news-card:hover,
.source-card:hover,
.compare-card:hover {
  border-color: rgba(72, 199, 202, 0.38);
  box-shadow: 0 18px 42px rgba(8, 45, 48, 0.12);
}

.news-card.is-read {
  background: #f8fbfb;
}

.news-card.has-media {
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.news-card-body {
  min-width: 0;
}

.news-media {
  display: block;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 4 / 3;
  background:
    linear-gradient(135deg, rgba(8, 109, 114, 0.08), transparent),
    #e9f2f1;
  border: 1px solid rgba(180, 211, 210, 0.82);
  border-radius: 8px;
}

.news-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.04) contrast(1.02);
  transition: transform 0.25s ease;
}

.news-card:hover .news-media img {
  transform: scale(1.035);
}

.news-card-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.news-card-top > div {
  min-width: 0;
}

.digest-card h3 {
  margin: 0;
  color: #07141a;
  font-size: 19px;
  font-weight: 650;
  line-height: 1.48;
  overflow-wrap: anywhere;
}

.digest-card-summary h3 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.news-card h3,
.source-card h3,
.compare-card h3 {
  font-size: 18px;
  font-weight: 650;
}

.news-card p,
.source-card p {
  margin: 11px 0 0;
  color: #34434c;
  line-height: 1.58;
}

.trust-tag {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.44);
}

.tag-green {
  background: linear-gradient(180deg, #e4f8ef, var(--green-bg));
  color: var(--green-ink);
}

.tag-amber {
  background: linear-gradient(180deg, #fff7d9, var(--amber-bg));
  color: var(--amber-ink);
}

.tag-blue {
  background: linear-gradient(180deg, #e8f5ff, var(--blue-bg));
  color: var(--blue-ink);
}

.tag-red {
  background: linear-gradient(180deg, #fff0ec, var(--red-bg));
  color: var(--red-ink);
}

.tag-gray {
  background: var(--gray-bg);
  color: var(--gray-ink);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
}

.meta-row span {
  min-height: 28px;
  padding: 5px 10px;
  color: var(--muted);
  background: rgba(244, 248, 248, 0.86);
  border: 1px solid rgba(226, 238, 237, 0.9);
  border-radius: 6px;
  font-size: 12.5px;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 14px;
}

.digest-card .meta-row,
.digest-card .card-actions {
  margin-top: 0;
}

.compact-select {
  width: 180px;
}

.compare-shelf {
  margin-bottom: 14px;
}

.spec-note {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 13px 14px;
  color: #53606a;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 250, 249, 0.92)),
    linear-gradient(135deg, rgba(214, 178, 94, 0.1), transparent);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
  box-shadow: var(--shadow-soft);
}

.spec-note strong {
  flex: 0 0 auto;
  color: var(--ink);
}

.spec-compare {
  overflow-x: auto;
  padding-bottom: 4px;
}

.brand-spec-group {
  min-width: 760px;
  margin-bottom: 18px;
}

.brand-spec-group:last-child {
  margin-bottom: 0;
}

.brand-spec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 0 2px;
}

.brand-spec-head h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.brand-spec-head span {
  color: var(--muted);
  font-size: 13px;
}

.spec-grid {
  display: grid;
  min-width: max(760px, calc(84px + var(--device-count) * 170px));
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.spec-row {
  display: grid;
  grid-template-columns: 84px repeat(var(--device-count), minmax(170px, 1fr));
  border-top: 1px solid var(--line);
}

.spec-row:first-child {
  border-top: 0;
}

.spec-label {
  padding: 15px 12px;
  color: var(--muted);
  background: rgba(242, 248, 247, 0.94);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.4;
}

.spec-device,
.spec-cell {
  min-width: 0;
  padding: 14px;
  border-left: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.58;
}

.spec-header-row .spec-label,
.spec-header-row .spec-device {
  background: #fbfdfd;
}

.spec-device strong {
  display: block;
  margin-bottom: 7px;
  font-size: 18px;
  line-height: 1.2;
}

.spec-device > span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.spec-device .trust-tag {
  display: inline-flex;
  margin-top: 10px;
}

.spec-source {
  display: inline-flex;
  margin-top: 10px;
  color: var(--accent-strong);
  font-size: 12px;
  text-decoration: none;
}

.spec-source:hover {
  text-decoration: underline;
}

.spec-cell span {
  display: block;
}

.spec-cell span + span {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #eef2f3;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.source-card {
  display: grid;
  align-content: start;
  gap: 10px;
}

.source-card .link-button {
  justify-self: start;
}

.primary-button,
.secondary-button {
  width: 100%;
  margin-top: 12px;
  font-weight: 750;
}

.small-note,
.empty-state {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

body.redbook-open {
  overflow: hidden;
}

button:disabled {
  cursor: default;
  opacity: 0.68;
}

.redbook-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(7, 25, 28, 0.52);
  backdrop-filter: blur(8px);
}

.redbook-overlay[hidden] {
  display: none;
}

.redbook-panel {
  width: min(1100px, 100%);
  max-height: min(860px, calc(100vh - 48px));
  overflow: auto;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 251, 250, 0.96)),
    linear-gradient(135deg, rgba(72, 199, 202, 0.12), transparent);
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 8px;
  box-shadow: 0 32px 90px rgba(5, 28, 31, 0.34);
}

.redbook-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.redbook-panel-head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.redbook-close-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  color: var(--accent-strong);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(8, 45, 48, 0.08);
}

.redbook-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
  margin-top: 18px;
}

.redbook-visual-stack,
.redbook-copy-stack {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
}

.redbook-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.redbook-reference,
.redbook-step {
  padding: 14px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(220, 235, 234, 0.92);
  border-radius: 8px;
  box-shadow: 0 10px 22px rgba(8, 45, 48, 0.07);
}

.redbook-reference {
  display: grid;
  place-items: center;
  min-height: 240px;
  overflow: hidden;
}

.redbook-reference a,
.redbook-reference img {
  display: block;
  width: 100%;
}

.redbook-reference img {
  max-height: 420px;
  object-fit: contain;
  border-radius: 8px;
}

.redbook-reference-empty {
  display: grid;
  gap: 8px;
  justify-items: center;
  color: var(--muted);
  text-align: center;
}

.redbook-reference-empty strong {
  color: var(--ink);
}

.redbook-insight {
  margin: 0;
  color: #2f3e46;
  line-height: 1.65;
}

.redbook-step-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.redbook-step-head .redbook-label {
  margin-bottom: 0;
}

.redbook-copy-button {
  width: auto;
  min-height: 30px;
  margin-top: 0;
  padding: 6px 10px;
  font-size: 12px;
}

.redbook-field {
  width: 100%;
  margin-top: 0;
  padding: 10px 12px;
  color: #23323a;
  background: #f8fbfb;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  line-height: 1.58;
  resize: vertical;
}

.redbook-body {
  min-height: 180px;
}

.redbook-prompt {
  min-height: 220px;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: minmax(0, 1fr);
    padding: 16px 20px 28px;
  }

  .daily-hero {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .daily-meta {
    justify-items: start;
    width: 100%;
  }
}

@media (max-width: 1180px) {
  .daily-hero {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .daily-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-items: start;
    width: 100%;
    max-width: none;
  }

  .daily-meta .notify-button,
  .daily-meta small:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 980px) {
  .topbar {
    position: static;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .view-tabs {
    grid-template-columns: repeat(4, 1fr);
  }

  .digest-card.has-media .digest-card-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .news-card.has-media {
    grid-template-columns: minmax(0, 1fr);
  }

  .digest-board {
    grid-template-columns: minmax(0, 1fr);
  }

}

@media (max-width: 860px) {
  .topbar {
    position: static;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .view-tabs {
    grid-template-columns: repeat(4, 1fr);
  }

  .workspace {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }

  body[data-view="devices"] .workspace {
    grid-template-columns: 1fr;
  }

  .daily-hero {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 18px;
  }

  .daily-meta {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .section-heading,
  .news-card-top {
    display: grid;
  }

  .digest-card.has-media .digest-card-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .digest-board {
    grid-template-columns: minmax(0, 1fr);
  }

  .counter-strip {
    justify-content: start;
  }

  .compact-select {
    width: 100%;
  }

  .spec-note {
    display: grid;
  }

  .redbook-overlay {
    align-items: start;
    padding: 12px;
  }

  .redbook-panel {
    max-height: calc(100vh - 24px);
    padding: 14px;
  }

  .redbook-layout {
    grid-template-columns: 1fr;
  }

  .redbook-reference {
    min-height: 180px;
  }

}

@media (max-width: 560px) {
  .topbar {
    padding: 12px;
  }

  .app-view {
    padding: 14px;
  }

  .daily-hero h2 {
    font-size: 24px;
  }

  .daily-intro {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .hero-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .hero-stats span {
    min-height: 46px;
    padding: 8px 6px;
    font-size: 11px;
  }

  .hero-stats strong {
    font-size: 18px;
  }

  .daily-meta {
    display: none;
  }

  .digest-column-head {
    display: grid;
    align-items: start;
  }

  .priority-day-items::before {
    left: 51px;
  }

  .priority-item {
    grid-template-columns: 42px 18px minmax(0, 1fr);
    padding-bottom: 10px;
  }

  .priority-rank {
    padding-top: 16px;
    padding-right: 6px;
    font-size: 11px;
  }

  .priority-dot {
    top: 18px;
    width: 7px;
    height: 7px;
  }

  .digest-card-summary {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 14px;
  }

  .digest-preview {
    -webkit-line-clamp: 1;
  }

  .priority-reason-text {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    padding: 6px 8px;
  }

  .expand-hint {
    justify-self: start;
  }

  .digest-card-head {
    align-items: flex-start;
  }

  .digest-card[open] .digest-card-grid {
    margin: 0 14px 14px;
  }

  .news-card h3,
  .source-card h3,
  .compare-card h3 {
    font-size: 16px;
  }

  .redbook-panel-head h2 {
    font-size: 20px;
  }

}
