/* ------------------------------------------------------------------
   拾光 · XHS → WeChat
   Warm editorial UI, responsive from 360px phones to wide desktops.
------------------------------------------------------------------ */
:root {
  --bg: #f5f0e7;
  --bg-deep: #eee6da;
  --surface: #fffdf9;
  --surface-2: #faf6ef;
  --ink: #252b2c;
  --ink-soft: #505857;
  --muted: #8b8f89;
  --line: #e5ded2;
  --line-strong: #d7cebf;
  --coral: #df5a49;
  --coral-deep: #c74839;
  --coral-soft: #fbe9e5;
  --gold: #b8893c;
  --gold-soft: #f7edd8;
  --green: #527a69;
  --green-soft: #e7f0eb;
  --blue: #4f6f86;
  --blue-soft: #e9f0f4;
  --danger: #b63f37;
  --danger-soft: #fbeae8;
  --shadow-sm: 0 1px 2px rgba(46, 39, 30, .04), 0 6px 20px rgba(46, 39, 30, .035);
  --shadow-md: 0 10px 35px rgba(52, 43, 33, .09);
  --shadow-lg: 0 24px 80px rgba(40, 33, 24, .18);
  --radius: 18px;
  --radius-sm: 12px;
  --sidebar: 248px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 700px at 78% -10%, rgba(224, 128, 108, .09), transparent 65%),
    radial-gradient(900px 600px at 25% 110%, rgba(101, 130, 111, .07), transparent 65%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
code, .mono { font-family: var(--mono); font-size: .88em; }
::selection { background: #f5c9c0; color: var(--ink); }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 18px; height: 18px; flex: 0 0 auto;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.rotate-90 { transform: rotate(90deg); }
.muted { color: var(--muted); }
.ok-text { color: var(--green); }
.warn-text { color: var(--coral-deep); }
.required { color: var(--coral); }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { font-size: clamp(28px, 3.2vw, 42px); line-height: 1.14; letter-spacing: -.035em; margin-bottom: 10px; font-weight: 700; }
h2 { font-size: 21px; letter-spacing: -.02em; margin-bottom: 6px; font-weight: 650; }
h3 { font-size: 17px; margin-bottom: 8px; font-weight: 650; }
.eyebrow {
  margin: 0 0 9px; color: var(--coral-deep); font-size: 10.5px;
  font-weight: 750; letter-spacing: .19em; text-transform: uppercase;
}
.page-sub { color: var(--ink-soft); margin-bottom: 0; max-width: 680px; font-size: 14.5px; }

/* ----------------------------- shell ----------------------------- */
.app-shell { padding-left: var(--sidebar); }
.sidebar {
  position: fixed; z-index: 30; inset: 0 auto 0 0; width: var(--sidebar);
  display: flex; flex-direction: column; padding: 26px 20px 18px;
  background: rgba(253, 250, 244, .92);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  position: relative; width: 37px; height: 37px; border-radius: 12px;
  background: var(--ink); display: inline-block; flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}
.brand-mark span:nth-child(1) {
  position: absolute; width: 13px; height: 15px; border-radius: 7px 7px 3px 3px;
  background: #f4c8bd; left: 9px; top: 9px; transform: rotate(-13deg);
}
.brand-mark span:nth-child(2) {
  position: absolute; width: 12px; height: 13px; border-radius: 7px 7px 3px 3px;
  background: var(--coral); right: 8px; bottom: 8px; transform: rotate(11deg);
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.15; }
.brand-copy strong { font-size: 20px; letter-spacing: .12em; font-weight: 720; }
.brand-copy small { color: var(--muted); font-size: 10px; letter-spacing: .1em; margin-top: 4px; }
.sidebar-create { margin: 28px 0 18px; justify-content: center; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px;
  border-radius: 11px; color: var(--ink-soft); font-size: 14px; font-weight: 550;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.nav-item:hover { background: rgba(224, 90, 73, .07); color: var(--coral-deep); }
.nav-item.active { background: var(--ink); color: #fff9ef; box-shadow: var(--shadow-sm); }
.nav-item.active .icon { color: #f5c9bd; }
.sidebar-spacer { flex: 1; min-height: 24px; }
.sidebar-status {
  border: 1px solid var(--line); border-radius: 15px; padding: 14px;
  background: linear-gradient(150deg, #fffdf9, #f7f0e6);
}
.status-line { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 650; }
.status-mini { display: flex; flex-direction: column; gap: 2px; color: var(--muted); font-size: 11px; margin: 8px 0 10px 16px; }
.status-link { color: var(--coral-deep); font-size: 11.5px; display: inline-flex; align-items: center; gap: 2px; }
.status-link .icon { width: 13px; height: 13px; }
.pulse-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.pulse-dot.is-on { background: #4f8b70; box-shadow: 0 0 0 4px rgba(79, 139, 112, .13); animation: pulse 2.4s infinite; }
.pulse-dot.is-off { background: #b7aea1; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(79,139,112,.09); } 50% { box-shadow: 0 0 0 6px rgba(79,139,112,.16); } }
.sidebar-footer { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 11px; margin-top: 14px; }
.sidebar-footer form { margin: 0; }
.logout-btn { display: inline-flex; align-items: center; gap: 5px; background: none; border: 0; color: var(--muted); padding: 2px; font-size: 11px; }
.logout-btn:hover { color: var(--coral-deep); }
.logout-btn .icon { width: 15px; height: 15px; }
.mobile-topbar, .mobile-tabbar { display: none; }
.main { min-height: 100vh; }
.page-wrap { width: min(1420px, 100%); margin: 0 auto; padding: 44px 46px 28px; }

/* ----------------------------- page bits ----------------------------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.page-head h1 { margin-bottom: 8px; }
.head-actions { display: flex; flex-wrap: wrap; gap: 9px; flex: 0 0 auto; }
.eyebrow + h1 { margin-top: 0; }
.back-link { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: 12.5px; margin-bottom: 13px; }
.back-link:hover { color: var(--coral-deep); }
.back-link .icon { width: 14px; height: 14px; }
.title-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.title-line h1 { margin-bottom: 0; }
.page-footer { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 11px; padding: 34px 4px 6px; }

/* ----------------------------- buttons ----------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 9px 16px; border: 1px solid transparent;
  border-radius: 11px; font-size: 13.5px; font-weight: 600; line-height: 1.2;
  white-space: nowrap; transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn.disabled { opacity: .45; pointer-events: none; transform: none; }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--coral); color: #fff; box-shadow: 0 5px 16px rgba(201, 72, 57, .2); }
.btn-primary:hover { background: var(--coral-deep); box-shadow: 0 7px 20px rgba(201, 72, 57, .26); }
.btn-secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { border-color: #c8bcac; background: #fff; }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-ghost:hover { background: rgba(37, 43, 44, .05); color: var(--ink); }
.btn-tiny { min-height: 31px; padding: 5px 10px; border-radius: 8px; font-size: 12px; }
.btn-tiny .icon { width: 14px; height: 14px; }
.btn-block { width: 100%; }
.btn-lg { min-height: 48px; font-size: 15px; border-radius: 13px; }
.btn.is-loading { color: transparent !important; pointer-events: none; position: relative; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 17px; height: 17px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; animation: spin .7s linear infinite;
}
.btn-secondary.is-loading::after, .btn-ghost.is-loading::after { border-color: rgba(37,43,44,.2); border-top-color: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn {
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--ink-soft);
  font-size: 23px; line-height: 1; transition: background .16s;
}
.icon-btn:hover { background: rgba(37,43,44,.06); color: var(--ink); }
.danger-link { color: var(--danger); }
.danger-link:hover { background: var(--danger-soft); color: var(--danger); }
.stack-actions { display: flex; flex-direction: column; gap: 8px; }
.inline-actions { display: flex; gap: 7px; flex-wrap: wrap; }

/* ----------------------------- forms ----------------------------- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field > span { font-size: 12.5px; font-weight: 650; color: var(--ink-soft); }
.input {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 11px;
  background: #fff; color: var(--ink); padding: 10px 12px; min-height: 42px;
  outline: none; transition: border-color .16s, box-shadow .16s, background .16s;
}
.input:hover { border-color: #c7bbab; }
.input:focus { border-color: var(--coral); box-shadow: 0 0 0 3px rgba(223,90,73,.11); background: #fff; }
.input::placeholder { color: #b4afa6; }
textarea.input { resize: vertical; min-height: 90px; line-height: 1.7; }
.input-title { font-size: 20px; font-weight: 650; padding: 12px 14px; }
.textarea-content { min-height: 280px; font-size: 15px; }
.textarea-code { font-family: var(--mono); font-size: 12px; }
.input-small { min-height: 35px; padding: 5px 10px; width: auto; font-size: 12px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.form-help { color: var(--muted); font-size: 11.5px; line-height: 1.65; margin: 5px 0 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 15px; border-top: 1px solid var(--line); margin-top: 5px; }
.form-actions.between { justify-content: space-between; align-items: center; }
.checkline { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-soft); font-size: 12.5px; cursor: pointer; }
.checkline input { accent-color: var(--coral); width: 16px; height: 16px; }
.required { font-weight: 700; }
.switch { position: relative; display: inline-flex; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track { width: 42px; height: 24px; border-radius: 20px; background: #d9d1c6; transition: background .2s; display: inline-flex; align-items: center; padding: 2px; }
.switch-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.16); transition: transform .2s; }
.switch input:checked + .switch-track { background: var(--coral); }
.switch input:checked + .switch-track .switch-thumb { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 3px solid rgba(223,90,73,.2); }

/* ----------------------------- flash / toast ----------------------------- */
.flash-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.flash {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  border: 1px solid var(--line); background: var(--surface); border-radius: 11px;
  padding: 11px 14px; font-size: 13px; box-shadow: var(--shadow-sm);
}
.flash-success { border-color: #bcd9cb; background: #f0f8f4; color: #356351; }
.flash-error { border-color: #ebc3bd; background: var(--danger-soft); color: var(--danger); }
.flash-warning { border-color: #ead4a8; background: #fdf6e8; color: #89682f; }
.flash-info { border-color: #c8dbe4; background: #f0f6fa; color: #3f6175; }
.flash-close, .toast-close { background: none; border: 0; color: currentColor; font-size: 19px; opacity: .55; padding: 0 2px; }
.toast-stack { position: fixed; right: 22px; bottom: 24px; z-index: 150; display: flex; flex-direction: column; gap: 9px; pointer-events: none; }
.toast {
  min-width: 230px; max-width: 360px; display: flex; align-items: center; gap: 10px;
  border-radius: 12px; padding: 12px 14px; background: var(--ink); color: #fffdf8;
  font-size: 13px; box-shadow: var(--shadow-md); pointer-events: auto;
  animation: toast-in .25s ease both;
}
.toast.success { background: #335f4e; }
.toast.error { background: #963b33; }
.toast .toast-close { margin-left: auto; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* ----------------------------- panels ----------------------------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 24px; margin-bottom: 22px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 15px; }
.panel-head h2, .panel-head h3 { margin-bottom: 0; }
.panel-head .eyebrow { margin-bottom: 5px; }
.panel-intro { color: var(--ink-soft); font-size: 13px; margin: -3px 0 18px; }
.count-badge, .count-pill, .live-pill, .trigger-tag {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 999px;
  background: var(--bg); color: var(--ink-soft); font-size: 11.5px; font-weight: 650;
  padding: 4px 10px; white-space: nowrap;
}
.count-pill { background: #f5efe5; }
.live-pill { background: var(--green-soft); color: var(--green); }
.live-pill .pulse-dot { width: 6px; height: 6px; }
.notice { display: flex; gap: 10px; border-radius: 12px; padding: 13px 15px; font-size: 12.5px; margin-bottom: 18px; line-height: 1.65; }
.notice > .icon { margin-top: 1px; }
.notice p { margin: 3px 0 0; }
.pre-line { white-space: pre-line; }
.notice-ok { background: var(--green-soft); color: #3a6151; border: 1px solid #c9ded3; }
.notice-info { background: var(--blue-soft); color: #3e6073; border: 1px solid #ccdde5; }
.notice-warn { background: #fbf3e2; color: #80622c; border: 1px solid #eed9b0; }
.notice-error { background: var(--danger-soft); color: var(--danger); border: 1px solid #ebc4bf; }
.compact-notice { margin: 17px 0 0; }
.empty { text-align: center; padding: 34px 20px; color: var(--muted); }
.empty.compact { padding: 22px; }
.empty p { margin-bottom: 12px; }
.empty-state { text-align: center; padding: 72px 20px 50px; background: rgba(255, 253, 249, .55); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty-state h2 { margin: 22px 0 7px; }
.empty-state p { color: var(--muted); margin-bottom: 20px; }
.empty-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.empty-illustration { position: relative; width: 150px; height: 112px; margin: 0 auto; }
.paper { position: absolute; display: flex; align-items: center; justify-content: center; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); box-shadow: var(--shadow-md); }
.paper-a { width: 86px; height: 93px; left: 10px; top: 12px; transform: rotate(-9deg); background: #f2d8cf; }
.paper-b { width: 86px; height: 93px; right: 9px; top: 7px; transform: rotate(8deg); background: #dfe9df; }
.paper-c { width: 86px; height: 93px; left: 32px; top: 0; color: var(--coral); font-size: 24px; flex-direction: column; gap: 7px; }
.paper-c::after { content: "等待新内容"; font-size: 9px; color: var(--muted); letter-spacing: .08em; }
.paper-c .icon { width: 27px; height: 27px; }

/* ----------------------------- stats ----------------------------- */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat-card { display: flex; align-items: center; gap: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; padding: 15px 16px; box-shadow: var(--shadow-sm); }
.stat-icon { width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.stat-icon .icon { width: 19px; height: 19px; }
.stat-icon.coral { background: var(--coral-soft); color: var(--coral-deep); }
.stat-icon.gold { background: var(--gold-soft); color: var(--gold); }
.stat-icon.green { background: var(--green-soft); color: var(--green); }
.stat-icon.ink { background: #ebe8e2; color: var(--ink); }
.stat-card > div { display: flex; flex-direction: column; line-height: 1.15; }
.stat-card strong { font-size: 24px; letter-spacing: -.04em; }
.stat-card span:last-child { color: var(--muted); font-size: 11.5px; margin-top: 3px; }
.latest-run-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: rgba(255,253,249,.72); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-size: 12px; color: var(--ink-soft); }
.latest-run-left, .latest-run-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.latest-run-right { color: var(--muted); }
.latest-run-right b { color: var(--ink); }
.latest-run-right a { display: inline-flex; align-items: center; color: var(--coral-deep); font-weight: 600; }
.latest-run-right .icon { width: 13px; height: 13px; }
.run-status { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 8px; font-size: 10.5px; font-weight: 650; white-space: nowrap; }
.run-running { background: var(--blue-soft); color: var(--blue); }
.run-success { background: var(--green-soft); color: var(--green); }
.run-failed, .run-blocked { background: var(--danger-soft); color: var(--danger); }
.run-login_required { background: #fbf3e2; color: #80622c; }

/* ----------------------------- toolbar / filters ----------------------------- */
.toolbar-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 15px 18px; margin-bottom: 20px; }
.date-switcher { display: flex; align-items: center; gap: 8px; padding-bottom: 13px; border-bottom: 1px solid var(--line); position: relative; }
.date-arrow { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 9px; color: var(--muted); border: 1px solid transparent; }
.date-arrow:hover { background: var(--bg); color: var(--ink); }
.date-arrow .icon { width: 15px; height: 15px; }
.date-current { display: flex; align-items: baseline; gap: 8px; padding: 0 5px; }
.date-current > span { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.date-current small { color: var(--muted); font-size: 11.5px; }
.date-native { margin-left: auto; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-soft); border-radius: 9px; padding: 5px 7px; font-size: 11.5px; }
.filter-row { display: flex; align-items: center; gap: 12px; padding-top: 12px; flex-wrap: wrap; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 5px 11px; border-radius: 999px; font-size: 12px; color: var(--ink-soft); border: 1px solid transparent; }
.chip:hover { background: var(--bg); }
.chip.active { background: var(--ink); color: #fffaf2; }
.search-form {
  display: flex; align-items: center; gap: 7px; margin-left: auto; min-width: 230px;
  border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 4px 9px;
}
.search-form .icon { width: 15px; height: 15px; color: var(--muted); }
.search-form input[type=search] { border: 0; outline: 0; background: transparent; padding: 6px 0; min-width: 140px; font-size: 12.5px; flex: 1; }
.search-clear { color: var(--muted); font-size: 16px; padding: 0 3px; }
.account-filter .input { border-color: var(--line); background: var(--surface-2); }

/* ----------------------------- note cards ----------------------------- */
.note-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
.note-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s;
}
.note-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #d5c9b9; }
.note-card.has-keyword { border-color: #eac1b8; }
.note-card.has-keyword::before { content: ""; display: block; height: 3px; background: linear-gradient(90deg, var(--coral), #eda277); }
.note-cover { position: relative; aspect-ratio: 16 / 10; background: #eee7dc; overflow: hidden; }
.note-cover > a { display: block; width: 100%; height: 100%; }
.note-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.note-card:hover .note-cover img { transform: scale(1.035); }
.cover-placeholder { width: 100%; height: 100%; display: flex; flex-direction: column; gap: 5px; align-items: center; justify-content: center; color: #b7aa98; background: linear-gradient(135deg, #f4ece1, #e8dfd2); }
.cover-placeholder .icon { width: 30px; height: 30px; }
.cover-placeholder em { font-size: 34px; font-style: normal; font-weight: 700; color: #a99985; }
.status-badge { display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 650; white-space: nowrap; }
.status-idle { background: #f0ebe3; color: #7e776d; }
.status-pending { background: var(--blue-soft); color: var(--blue); }
.status-ok { background: var(--green-soft); color: var(--green); }
.status-draft { background: var(--gold-soft); color: var(--gold); }
.status-error { background: var(--danger-soft); color: var(--danger); }
.note-cover > .status-badge { position: absolute; top: 10px; right: 10px; background: rgba(255,253,249,.92); backdrop-filter: blur(8px); box-shadow: 0 2px 8px rgba(0,0,0,.07); }
.keyword-flag { position: absolute; left: 10px; top: 10px; display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 999px; background: var(--coral); color: #fff; font-size: 10px; font-weight: 650; box-shadow: 0 3px 10px rgba(201,72,57,.24); }
.keyword-flag .icon { width: 11px; height: 11px; }
.image-count { position: absolute; right: 10px; bottom: 10px; border-radius: 999px; background: rgba(28,31,32,.64); color: #fff; font-size: 9.5px; padding: 3px 8px; backdrop-filter: blur(6px); }
.note-body { padding: 15px 16px 13px; display: flex; flex-direction: column; flex: 1; }
.note-meta-top { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10.5px; margin-bottom: 6px; }
.note-meta-top time { margin-left: auto; font-variant-numeric: tabular-nums; }
.manual-tag { border-radius: 4px; background: var(--gold-soft); color: var(--gold); font-size: 9.5px; padding: 1px 5px; }
.note-body h2 { font-size: 16.5px; line-height: 1.45; margin: 0 0 7px; letter-spacing: -.015em; }
.note-body h2 a:hover { color: var(--coral-deep); }
.note-excerpt { color: var(--ink-soft); font-size: 12.5px; line-height: 1.65; margin: 0 0 11px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.keyword-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.keyword-tags span { display: inline-flex; align-items: center; gap: 3px; border-radius: 5px; background: var(--coral-soft); color: var(--coral-deep); font-size: 10px; padding: 2px 6px; }
.keyword-tags .more { background: var(--bg); color: var(--muted); }
.keyword-tags.large span { font-size: 12px; padding: 5px 10px; border-radius: 7px; }
.keyword-tags.large .icon { width: 12px; height: 12px; }
.note-actions { display: flex; align-items: center; gap: 4px; margin-top: auto; padding-top: 10px; border-top: 1px solid #f0eae1; flex-wrap: wrap; }
.note-actions .btn { padding-left: 8px; padding-right: 8px; }
.note-actions .source-link { margin-left: auto; }
.inline-note { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--muted); }
.inline-note.ok { color: var(--green); }
.inline-note .icon { width: 12px; height: 12px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 13px; padding: 26px 0 10px; }
.page-btn { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 6px 11px; font-size: 12px; }
.page-btn:hover { border-color: var(--line-strong); }
.page-btn.disabled { opacity: .4; }
.page-btn .icon { width: 14px; height: 14px; }
.page-info { color: var(--muted); font-size: 11.5px; }

/* ----------------------------- editor ----------------------------- */
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 20px; align-items: start; }
.editor-side { position: sticky; top: 24px; }
.editor-main .panel { margin-bottom: 18px; }
.char-count { color: var(--muted); font-size: 11px; background: var(--bg); border-radius: 999px; padding: 3px 8px; white-space: nowrap; }
.image-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-bottom: 13px; }
.image-tile { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 1; background: #ece5d9; border: 1px solid var(--line); display: block; }
.image-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.image-missing { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: var(--muted); font-size: 10px; }
.image-check { position: absolute; inset: auto 0 0; background: rgba(28,31,32,.7); color: #fff; font-size: 10px; display: flex; align-items: center; gap: 5px; padding: 5px 7px; backdrop-filter: blur(5px); }
.image-check input { accent-color: var(--coral); width: 13px; height: 13px; }
.image-index { position: absolute; top: 6px; left: 6px; width: 18px; height: 18px; border-radius: 50%; background: rgba(255,255,255,.9); font-size: 9px; display: flex; align-items: center; justify-content: center; color: var(--ink); }
.upload-zone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: 1.5px dashed var(--line-strong); border-radius: 12px; padding: 24px; color: var(--muted); cursor: pointer; transition: border-color .18s, background .18s; text-align: center; }
.upload-zone:hover { border-color: var(--coral); background: #fffbf8; }
.upload-zone .icon { width: 22px; height: 22px; color: var(--coral); }
.upload-zone strong { color: var(--ink-soft); font-size: 13px; }
.upload-zone span { font-size: 10.5px; }
.upload-preview { margin-top: 12px; }
.keyword-panel { background: #fffbf7; }
.publish-panel { background: linear-gradient(170deg, #fffdf9, #faf5ed); }
.meta-list { margin: 4px 0 16px; display: flex; flex-direction: column; gap: 8px; }
.meta-list > div { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.meta-list dt { color: var(--muted); }
.meta-list dd { margin: 0; text-align: right; color: var(--ink-soft); font-weight: 550; overflow-wrap: anywhere; }
.mini-warning { display: flex; gap: 8px; align-items: flex-start; background: #fbf3e2; border: 1px solid #ecd8b0; border-radius: 9px; color: #7c612f; padding: 9px 10px; font-size: 11.5px; margin-bottom: 13px; }
.mini-warning a { color: var(--coral-deep); text-decoration: underline; }
.publish-actions { display: flex; flex-direction: column; gap: 8px; }
.publish-note { color: var(--muted); font-size: 10.5px; line-height: 1.6; margin: 13px 0 0; }
.save-first { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px dashed var(--line-strong); border-radius: 10px; padding: 13px; color: var(--muted); }
.save-first p { margin: 0; font-size: 11.5px; }
.delete-form { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
.delete-form button { width: 100%; border: 0; background: none; padding: 6px; font-size: 12px; }
.editor-danger {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  border: 1px solid #ead4cf; background: #fdf8f6; border-radius: var(--radius);
  padding: 16px 20px; margin-top: 4px;
}
.editor-danger strong { font-size: 13px; color: var(--ink-soft); }
.editor-danger p { color: var(--muted); font-size: 11px; margin: 3px 0 0; }
.editor-danger form { margin: 0; flex: 0 0 auto; }
.preview-modal { max-width: 680px; }
.article-preview { max-height: 62vh; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.article-preview img { max-width: 100%; }
.preview-title { font-size: 24px; line-height: 1.45; letter-spacing: -.02em; margin: 6px 0 22px; padding-bottom: 16px; border-bottom: 1px solid #eee7dc; }

/* ----------------------------- settings ----------------------------- */
.effective-panel { background: linear-gradient(140deg, #fffdf9 0%, #f8f1e7 100%); }
.effective-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.effective-item { background: rgba(255,253,249,.94); padding: 12px 13px; min-height: 66px; display: flex; flex-direction: column; gap: 3px; }
.effective-item span { color: var(--muted); font-size: 10.5px; }
.effective-item strong { font-size: 12px; font-weight: 600; line-height: 1.45; }
.runtime-strip { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; color: var(--muted); font-size: 10.5px; }
.runtime-strip span { display: inline-flex; align-items: center; gap: 5px; }
.runtime-strip .icon { width: 13px; height: 13px; }
.settings-layout { display: grid; grid-template-columns: 178px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-nav { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 2px; padding: 8px 0; }
.settings-nav a { display: flex; align-items: center; gap: 9px; padding: 8px 11px; border-radius: 9px; color: var(--muted); font-size: 12px; }
.settings-nav a:hover { background: rgba(255,253,249,.75); color: var(--ink); }
.settings-nav a.active { background: var(--surface); color: var(--coral-deep); box-shadow: var(--shadow-sm); font-weight: 600; }
.settings-nav .icon { width: 15px; height: 15px; }
.settings-content { min-width: 0; }
.settings-content .panel { scroll-margin-top: 22px; }
.settings-rows { display: flex; flex-direction: column; }
.setting-row { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 16px; align-items: start; padding: 12px 0; border-bottom: 1px solid #f0eae1; }
.setting-row:last-child { border-bottom: 0; }
.setting-row .field-label { font-size: 12.5px; font-weight: 650; color: var(--ink-soft); padding-top: 11px; }
.setting-switch-row { grid-template-columns: 1fr auto; align-items: center; }
.setting-switch-row .field-label { padding-top: 0; }
.switch-label { font-size: 13px; font-weight: 600; cursor: pointer; }
.setting-switch-row .form-help { margin: 3px 0 0; max-width: 540px; }
.setting-row .form-help { grid-column: 2; margin: -7px 0 3px; }
.setting-switch-row .form-help { grid-column: 1; }
.account-list { display: flex; flex-direction: column; gap: 9px; margin-bottom: 18px; }
.account-card { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #fffdfa; }
.account-card.is-disabled { opacity: .66; background: #faf7f2; }
.account-avatar { width: 42px; height: 42px; border-radius: 12px; background: linear-gradient(135deg, #f4d3ca, #e8b2a5); color: #7d3b31; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; }
.account-main { min-width: 0; }
.account-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.account-title strong { font-size: 13.5px; }
.account-title .mono { color: var(--muted); font-size: 9.5px; }
.tag-on, .tag-off { border-radius: 999px; padding: 2px 7px; font-size: 9.5px; font-weight: 650; }
.tag-on { background: var(--green-soft); color: var(--green); }
.tag-off { background: var(--bg-deep); color: var(--muted); }
.account-url { display: inline-flex; align-items: center; gap: 3px; color: var(--blue); font-size: 10.5px; margin: 2px 0 5px; overflow-wrap: anywhere; }
.account-url .icon { width: 11px; height: 11px; }
.account-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: 10.5px; }
.account-error { display: flex; gap: 5px; align-items: flex-start; color: var(--danger); font-size: 10.5px; background: var(--danger-soft); border-radius: 6px; padding: 5px 7px; margin: 7px 0 0; }
.account-error .icon { width: 12px; height: 12px; margin-top: 1px; }
.account-actions { display: flex; gap: 3px; flex-wrap: wrap; justify-content: flex-end; }
.account-edit-form { grid-column: 1 / -1; border-top: 1px dashed var(--line); padding-top: 13px; margin-top: 4px; }
.account-edit-form[hidden] { display: none; }
.account-edit-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.add-account-form { border: 1px dashed var(--line-strong); background: var(--surface-2); border-radius: 13px; padding: 16px; }
.add-account-head { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 650; margin-bottom: 12px; color: var(--ink-soft); }
.add-account-head .icon { width: 15px; height: 15px; color: var(--coral); }
.cookie-status { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font-size: 11.5px; margin-bottom: 15px; }
.cookie-status > span:first-child { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); }
.cookie-status .icon { width: 14px; height: 14px; color: var(--green); }
.help-details { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 11px; color: var(--ink-soft); font-size: 12px; }
.help-details summary { cursor: pointer; color: var(--coral-deep); font-size: 12px; font-weight: 600; }
.help-details ol { margin: 10px 0 0; padding-left: 19px; color: var(--muted); line-height: 1.8; }
.wechat-test-result { font-size: 12px; border-radius: 9px; padding: 9px 12px; margin-bottom: 13px; }
.wechat-test-result.ok { background: var(--green-soft); color: var(--green); }
.wechat-test-result.error { background: var(--danger-soft); color: var(--danger); }
.runtime-list { margin: 0; display: flex; flex-direction: column; }
.runtime-list > div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 14px; padding: 8px 0; border-bottom: 1px solid #f0eae1; font-size: 12px; }
.runtime-list > div:last-child { border-bottom: 0; }
.runtime-list dt { color: var(--muted); }
.runtime-list dd { margin: 0; overflow-wrap: anywhere; color: var(--ink-soft); }
.compact-actions .btn { min-height: 32px; font-size: 11.5px; }

/* ----------------------------- collections ----------------------------- */
.run-overview { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 12px; margin-bottom: 18px; }
.run-overview-card { display: flex; align-items: center; gap: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow-sm); }
.run-overview-card > div { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.run-overview-card strong { font-size: 18px; letter-spacing: -.02em; }
.run-overview-card span:last-child { color: var(--muted); font-size: 10.5px; margin-top: 3px; }
.run-table-wrap { overflow-x: auto; }
.run-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.run-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 10.5px; letter-spacing: .04em; border-bottom: 1px solid var(--line); padding: 8px 9px; white-space: nowrap; }
.run-table td { border-bottom: 1px solid #f2ece3; padding: 10px 9px; vertical-align: middle; }
.run-table tr:last-child td { border-bottom: 0; }
.run-table tr.is-live { background: #fbfcfe; }
.run-table .run-id { color: var(--muted); font-size: 10.5px; }
.run-table .cell-action { text-align: right; }
.run-table .btn { font-size: 11px; }
.trigger-tag { background: var(--bg); }
.terminal {
  background: #202525; color: #dce5dc; border-radius: 11px; padding: 15px;
  font-family: var(--mono); font-size: 11.5px; line-height: 1.7; min-height: 180px;
  max-height: 45vh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
  margin: 13px 0; border: 1px solid #333c3b;
}
.terminal.large { min-height: 300px; max-height: 52vh; }
.run-summary { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.run-error { background: var(--danger-soft); color: var(--danger); border-radius: 8px; padding: 8px 10px; font-size: 11.5px; margin-bottom: 8px; }

/* ----------------------------- modals ----------------------------- */
.modal { position: fixed; inset: 0; z-index: 120; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal.is-open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(31, 29, 25, .46); backdrop-filter: blur(4px); animation: fade-in .18s ease; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  position: relative; z-index: 1; width: min(520px, 100%); max-height: 90vh; overflow-y: auto;
  background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg);
  padding: 24px; animation: modal-in .22s ease;
}
.modal-wide { width: min(720px, 100%); }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; justify-content: space-between; gap: 15px; align-items: flex-start; margin-bottom: 16px; }
.modal-head h2 { font-size: 21px; margin-bottom: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 15px; flex-wrap: wrap; }
.test-form { display: flex; gap: 10px; align-items: flex-end; }
.test-form .field { flex: 1; margin-bottom: 0; }
.single-intro { margin: -4px 0 13px; }
.single-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.single-actions .form-help { margin: 0; flex: 1 1 260px; }
body.modal-open { overflow: hidden; }

/* ----------------------------- login ----------------------------- */
.login-shell { background: var(--bg); }
.login-layout { min-height: 100vh; display: grid; grid-template-columns: 1.08fr .92fr; }
.login-visual { position: relative; background: #222b2c; color: #f7f0e5; padding: 40px 54px; overflow: hidden; display: flex; flex-direction: column; }
.login-visual::before { content: ""; position: absolute; width: 650px; height: 650px; border-radius: 50%; right: -240px; top: -230px; background: radial-gradient(circle, rgba(223,90,73,.52), transparent 68%); }
.login-visual::after { content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%; left: -250px; bottom: -230px; background: radial-gradient(circle, rgba(111,150,126,.3), transparent 68%); }
.brand.light { color: #fffaf2; position: relative; z-index: 2; }
.brand.light .brand-mark { background: #f7f0e5; }
.brand.light .brand-copy small { color: #b9b6ad; }
.login-visual-copy { position: relative; z-index: 2; margin: auto 0; max-width: 600px; }
.login-visual-copy .eyebrow { color: #e99a89; }
.login-visual-copy h1 { font-size: clamp(32px, 4vw, 54px); font-weight: 650; line-height: 1.28; letter-spacing: -.035em; margin-bottom: 22px; }
.login-visual-copy p:last-child { color: #b8b9b1; font-size: 14.5px; max-width: 480px; line-height: 1.9; }
.login-collage { position: relative; z-index: 2; height: 205px; margin-bottom: 28px; }
.mock-card { position: absolute; width: 210px; background: #f9f4eb; border-radius: 14px; padding: 9px; box-shadow: 0 20px 45px rgba(0,0,0,.28); }
.mock-card-one { left: 0; top: 0; transform: rotate(-4deg); }
.mock-card-two { left: 170px; top: 20px; transform: rotate(4deg); width: 190px; }
.mock-cover { height: 112px; border-radius: 9px; display: flex; align-items: flex-end; padding: 12px; color: #fff; font-size: 13px; font-weight: 650; letter-spacing: .08em; }
.mock-cover.warm { background: linear-gradient(145deg, #d27967, #9f4d41); }
.mock-cover.sage { background: linear-gradient(145deg, #819986, #4e6b5a); }
.mock-lines { padding: 10px 4px 3px; display: flex; flex-direction: column; gap: 5px; }
.mock-lines i { display: block; height: 5px; border-radius: 4px; background: #d9cfc1; width: 86%; }
.mock-lines i:nth-child(2) { width: 62%; }
.mock-lines b { display: block; height: 5px; width: 35%; border-radius: 4px; background: #d27967; margin-top: 2px; }
.mock-badge { position: absolute; left: 295px; top: 93px; display: flex; align-items: center; gap: 6px; background: #f1c2b5; color: #6e332b; border-radius: 999px; padding: 8px 13px; font-size: 11px; font-weight: 650; box-shadow: 0 10px 25px rgba(0,0,0,.2); transform: rotate(-2deg); }
.mock-badge .icon { width: 13px; height: 13px; }
.login-footnote { position: relative; z-index: 2; color: #8d948e; font-size: 11px; margin: 0; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px; background: radial-gradient(600px 400px at 80% 10%, #fffaf1, transparent 70%), var(--bg); }
.login-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 34px; box-shadow: var(--shadow-md); }
.login-card h2 { font-size: 28px; margin-bottom: 7px; letter-spacing: -.03em; }
.login-sub { color: var(--muted); font-size: 12.5px; margin-bottom: 22px; }
.login-form .field { margin-bottom: 18px; }
.password-wrap { position: relative; display: block; }
.password-wrap .input { padding-right: 58px; }
.password-toggle { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); border: 0; background: var(--bg); color: var(--ink-soft); border-radius: 6px; padding: 4px 8px; font-size: 10.5px; }
.login-note { display: flex; gap: 9px; background: var(--surface-2); border-radius: 10px; padding: 11px 12px; margin-top: 20px; color: var(--muted); font-size: 10.5px; line-height: 1.7; }
.login-note .icon { width: 15px; height: 15px; color: var(--green); margin-top: 1px; }
.login-note p { margin: 0; }
.login-note code { color: var(--ink-soft); background: #eee7dc; border-radius: 3px; padding: 1px 4px; }

/* ----------------------------- error ----------------------------- */
.error-page { text-align: center; padding: 100px 20px; }
.error-code { font-size: 100px; line-height: 1; font-weight: 800; letter-spacing: -.08em; color: #dfd3c2; display: block; }
.error-page h1 { margin: 15px 0 8px; }
.error-page p { color: var(--muted); margin-bottom: 24px; }

/* ----------------------------- responsive ----------------------------- */
@media (max-width: 1280px) {
  .page-wrap { padding: 38px 32px 24px; }
  .note-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .effective-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .editor-layout { grid-template-columns: minmax(0, 1fr) 310px; }
  .settings-layout { grid-template-columns: 150px minmax(0, 1fr); gap: 18px; }
  .settings-nav a { padding: 7px 8px; }
}
@media (max-width: 980px) {
  .app-shell { padding-left: 0; padding-bottom: 76px; }
  .sidebar { display: none; }
  .mobile-topbar {
    display: flex; position: sticky; top: 0; z-index: 40; align-items: center;
    justify-content: space-between; padding: 10px 16px; background: rgba(250,246,238,.9);
    border-bottom: 1px solid var(--line); backdrop-filter: blur(16px);
  }
  .compact-brand { gap: 8px; }
  .compact-brand .brand-mark { width: 31px; height: 31px; border-radius: 10px; }
  .compact-brand .brand-mark span:nth-child(1) { width: 11px; height: 13px; left: 7px; top: 7px; }
  .compact-brand .brand-mark span:nth-child(2) { width: 10px; height: 11px; right: 6px; bottom: 6px; }
  .compact-brand strong { font-size: 17px; letter-spacing: .1em; }
  .mobile-actions { display: flex; gap: 2px; }
  .mobile-tabbar {
    display: flex; position: fixed; z-index: 50; inset: auto 0 0; height: 64px;
    padding: 7px max(10px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom));
    background: rgba(255,253,249,.96); border-top: 1px solid var(--line);
    backdrop-filter: blur(18px); align-items: center; justify-content: space-around;
  }
  .tab-item { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: 9.5px; border: 0; background: none; min-width: 48px; padding: 3px; }
  .tab-item.active { color: var(--coral-deep); }
  .tab-item .icon { width: 19px; height: 19px; }
  .tab-logout { margin: 0; }
  .tab-create { width: 48px; height: 48px; margin-top: -24px; border-radius: 50%; background: var(--coral); color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 7px 20px rgba(201,72,57,.32); border: 5px solid var(--bg); }
  .tab-create .icon { width: 22px; height: 22px; }
  .page-wrap { padding: 26px 18px calc(22px + env(safe-area-inset-bottom)); }
  .page-head { align-items: flex-start; flex-direction: column; gap: 16px; }
  .head-actions { width: 100%; }
  .page-footer { padding-bottom: 8px; flex-direction: column; gap: 4px; }
  .editor-layout { grid-template-columns: 1fr; }
  .editor-side { position: static; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { display: none; }
  .effective-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .run-overview { grid-template-columns: 1fr 1fr; }
  .run-overview-card.wide { grid-column: span 2; }
  .filter-row { align-items: stretch; }
  .search-form { margin-left: 0; flex: 1 1 240px; }
  .account-filter { width: 100%; }
  .account-filter .input { width: 100%; }
  .logged-out-side { display: none; }
}
@media (max-width: 760px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .note-grid { grid-template-columns: 1fr; gap: 14px; }
  .note-cover { aspect-ratio: 16 / 9; }
  .form-grid, .form-grid.three, .form-grid.two { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: span 1; }
  .setting-row, .setting-switch-row { grid-template-columns: 1fr; gap: 6px; }
  .setting-row .field-label { padding-top: 0; }
  .setting-row .form-help { grid-column: 1; margin: 0; }
  .setting-switch-row { grid-template-columns: 1fr auto; align-items: center; }
  .account-card { grid-template-columns: 38px minmax(0, 1fr); }
  .account-actions { grid-column: 2; justify-content: flex-start; }
  .account-avatar { width: 38px; height: 38px; }
  .run-table thead { display: none; }
  .run-table, .run-table tbody, .run-table tr, .run-table td { display: block; width: 100%; }
  .run-table tr { border: 1px solid var(--line); border-radius: 12px; padding: 8px; margin-bottom: 9px; background: #fffdfa; }
  .run-table td { border: 0; padding: 4px 5px; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .run-table td::before { content: attr(data-label); color: var(--muted); font-size: 10px; }
  .run-table td.cell-action { justify-content: flex-end; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 7px; }
  .run-table td.cell-action::before { display: none; }
  .login-layout { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; padding: 24px 16px; }
  .login-card { padding: 27px 22px; }
  .image-grid { grid-template-columns: repeat(3, 1fr); }
  .article-preview { padding: 15px; }
  .modal { padding: 10px; align-items: flex-end; }
  .modal-card { max-height: 92vh; border-radius: 18px; padding: 19px; width: 100%; }
  .modal-wide { width: 100%; }
  .test-form { flex-direction: column; align-items: stretch; }
  .terminal { max-height: 38vh; font-size: 10.5px; }
  .terminal.large { max-height: 48vh; }
  .date-native { font-size: 10.5px; max-width: 116px; }
  .date-current > span { font-size: 17px; }
  .date-current { gap: 5px; }
  .latest-run-bar { align-items: flex-start; }
  .latest-run-right { width: 100%; justify-content: flex-start; }
}
@media (max-width: 460px) {
  .page-wrap { padding-left: 13px; padding-right: 13px; }
  .head-actions .btn { flex: 1; }
  .stats-grid { gap: 9px; }
  .stat-card { padding: 12px; gap: 10px; }
  .stat-card strong { font-size: 20px; }
  .stat-icon { width: 33px; height: 33px; }
  .effective-grid { grid-template-columns: 1fr; }
  .effective-item { min-height: 0; }
  .run-overview { grid-template-columns: 1fr; }
  .run-overview-card.wide { grid-column: span 1; }
  .toolbar-card { padding: 12px; }
  .date-native { display: none; }
  .filter-row { gap: 8px; }
  .filter-chips { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .chip { flex: 0 0 auto; }
  .search-form { flex-basis: 100%; }
  .note-actions .btn { flex: 1; }
  .note-actions .source-link { flex: 0 0 auto; margin-left: 0; }
  .image-grid { grid-template-columns: repeat(2, 1fr); }
  .panel { padding: 17px; border-radius: 15px; }
  .account-title .mono { display: none; }
  .account-edit-bottom { flex-direction: column; align-items: flex-start; }
  .editor-danger { align-items: flex-start; flex-direction: column; gap: 12px; }
  .editor-danger form, .editor-danger .btn { width: 100%; }
  .cookie-status { align-items: flex-start; flex-direction: column; gap: 4px; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn { width: 100%; }
  .form-actions.between { align-items: stretch; }
  .publish-actions .btn { min-height: 45px; }
  .toast-stack { right: 12px; left: 12px; bottom: 82px; }
  .toast { min-width: 0; max-width: none; width: 100%; }
}

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