/* 设计令牌与样式，移植自 Claude Design 设计稿（Notion 风格）。 */
html, body, #app { margin: 0; height: 100%; }
:root, [data-theme="light"] {
  --bg:#FFFFFF; --side:#F7F7F5; --fg:#37352F; --fg2:#787774; --fg3:#9B9A97;
  --line:rgba(55,53,47,.09); --line-in:rgba(55,53,47,.16); --hover:rgba(55,53,47,.06); --press:rgba(55,53,47,.09);
  --accent:#2383E2; --accent-h:#0077D4; --accent-soft:rgba(35,131,226,.16);
  --pop:#FFFFFF; --pop-shadow:0 0 0 1px rgba(15,15,15,.05),0 4px 12px rgba(15,15,15,.1);
  --canvas:#F7F7F5; --ph1:rgba(55,53,47,.035); --ph2:rgba(55,53,47,.075); --toast:#37352F; --scrim:rgba(15,15,15,.4); --sw-off:rgba(55,53,47,.2);
  --gray:#787774; --gray-bg:#F1F1EF; --brown:#9F6B53; --brown-bg:#F4EEEE; --orange:#D9730D; --orange-bg:#FBECDD;
  --yellow:#CB912F; --yellow-bg:#FBF3DB; --green:#448361; --green-bg:#EDF3EC; --blue:#337EA9; --blue-bg:#E7F3F8;
  --purple:#9065B0; --purple-bg:#F6F3F9; --pink:#C14C8A; --pink-bg:#FAF1F5; --red:#D44C47; --red-bg:#FDEBEC;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg:#191919; --side:#202020; --fg:rgba(255,255,255,.81); --fg2:rgba(255,255,255,.46); --fg3:rgba(255,255,255,.28);
  --line:rgba(255,255,255,.094); --line-in:rgba(255,255,255,.16); --hover:rgba(255,255,255,.055); --press:rgba(255,255,255,.094);
  --accent-soft:rgba(35,131,226,.3); --pop:#252525; --pop-shadow:0 0 0 1px rgba(255,255,255,.094),0 4px 12px rgba(0,0,0,.4);
  --canvas:#202020; --ph1:rgba(255,255,255,.03); --ph2:rgba(255,255,255,.065); --toast:#3F3F3F; --scrim:rgba(0,0,0,.6); --sw-off:rgba(255,255,255,.18);
  --gray:#9B9B9B; --gray-bg:#2F2F2F; --brown:#BA856F; --brown-bg:#4A3228; --orange:#C77D48; --orange-bg:#5C3B23;
  --yellow:#CA9849; --yellow-bg:#564328; --green:#529E72; --green-bg:#243D30; --blue:#379AD3; --blue-bg:#143A4E;
  --purple:#9D68D3; --purple-bg:#3C2D49; --pink:#D15796; --pink-bg:#4E2C3C; --red:#E65B58; --red-bg:#522E2A;
  color-scheme: dark;
}
body {
  background: var(--bg); color: var(--fg);
  font-family: ui-sans-serif, -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: var(--line-in) transparent; }
::placeholder { color: var(--fg3); }
a { color: var(--accent); cursor: pointer; }
a:hover { color: var(--accent-h); }
button { font: inherit; }
button:disabled { cursor: not-allowed; }
input, textarea { font: inherit; color: var(--fg); }
img { display: block; }
@keyframes sa-pulse { 0%,100% { opacity: 1 } 50% { opacity: .4 } }
@keyframes sa-spin { to { transform: rotate(360deg) } }
@keyframes sa-in { from { transform: translateX(24px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes sa-up { from { transform: translate(-50%, 8px); opacity: 0 } to { transform: translate(-50%, 0); opacity: 1 } }

.mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; }
.muted { color: var(--fg2); } .faint { color: var(--fg3); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hov:hover { background: var(--hover); }
.hov:active { background: var(--press); }

/* 按钮 */
.btn { display: inline-flex; align-items: center; gap: 6px; border: none; border-radius: 6px; background: transparent; color: var(--fg); font-size: 14px; cursor: pointer; white-space: nowrap; }
.btn:disabled { opacity: .4; }
.btn-ghost { height: 28px; padding: 0 8px; color: var(--fg2); }
.btn-ghost:hover:not(:disabled) { background: var(--hover); }
.btn-ghost:active:not(:disabled) { background: var(--press); }
.btn-text { height: 32px; padding: 0 8px; }
.btn-text:hover:not(:disabled) { background: var(--hover); }
.btn-sec { height: 32px; padding: 0 12px; border: 1px solid var(--line-in); background: var(--bg); }
.btn-sec:hover:not(:disabled) { background: var(--hover); }
.btn-sec:active:not(:disabled) { background: var(--press); }
.btn-pri { height: 32px; padding: 0 14px; background: var(--accent); color: #fff; font-weight: 500; }
.btn-pri:hover:not(:disabled) { background: var(--accent-h); }
.btn-pri:disabled { opacity: .6; }
.btn-icon { width: 28px; height: 28px; padding: 0; justify-content: center; color: var(--fg2); }
.btn-icon:hover:not(:disabled) { background: var(--hover); }
.btn-danger { color: var(--red); }
.btn-danger:hover:not(:disabled) { background: var(--red-bg); }
.btn i { font-size: 16px; }

/* 标签（Notion 色板） */
.tag { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 6px; border-radius: 4px; font-size: 12px; white-space: nowrap; }
.c-gray { color: var(--gray); background: var(--gray-bg); } .c-brown { color: var(--brown); background: var(--brown-bg); }
.c-orange { color: var(--orange); background: var(--orange-bg); } .c-yellow { color: var(--yellow); background: var(--yellow-bg); }
.c-green { color: var(--green); background: var(--green-bg); } .c-blue { color: var(--blue); background: var(--blue-bg); }
.c-purple { color: var(--purple); background: var(--purple-bg); } .c-pink { color: var(--pink); background: var(--pink-bg); }
.c-red { color: var(--red); background: var(--red-bg); }

/* 下划线 Tab */
.tab { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 8px; border: none; background: transparent; color: var(--fg2); font-size: 14px; cursor: pointer; box-shadow: inset 0 -2px 0 transparent; }
.tab:hover { background: var(--hover); }
.tab.on { color: var(--fg); font-weight: 500; box-shadow: inset 0 -2px 0 var(--fg); }
.tab i { font-size: 16px; }
.tab .n { color: var(--fg3); font-weight: 400; }

/* 开关、复选框、转圈、骨架屏、占位图 */
.switch { width: 28px; height: 16px; flex-shrink: 0; border-radius: 8px; border: none; padding: 2px; display: flex; cursor: pointer; background: var(--sw-off); transition: background .15s; }
.switch.on { justify-content: flex-end; background: var(--accent); }
.switch > span { width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(15,15,15,.2); }
.switch:disabled { opacity: .4; }
.cb { width: 16px; height: 16px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; border: 1.5px solid var(--fg3); background: transparent; flex-shrink: 0; }
.cb i { font-size: 11px; color: #fff; display: none; }
.cb.on { background: var(--accent); border-color: var(--accent); }
.cb.on i { display: inline-block; }
.spin { display: inline-block; width: 12px; height: 12px; border: 1.5px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: sa-spin .8s linear infinite; flex-shrink: 0; }
.skel { background: var(--hover); border-radius: 4px; animation: sa-pulse 1.6s ease-in-out infinite; }
.ph { background: repeating-linear-gradient(135deg, var(--ph1) 0 8px, var(--ph2) 8px 16px); }
.caret { display: inline-flex; width: 18px; justify-content: center; font-size: 10px; transition: transform .15s; color: var(--fg2); }
.caret.open { transform: rotate(90deg); }
.progress { height: 4px; border-radius: 2px; background: var(--press); overflow: hidden; }
.progress > div { height: 100%; border-radius: 2px; background: var(--accent); transition: width .3s; }

/* 输入框 */
.ring { border-radius: 6px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-in); transition: box-shadow .12s; }
.ring:focus-within, .ring:focus { box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 3px var(--accent-soft); outline: none; }
.field { height: 32px; border: none; outline: none; padding: 0 10px; font-size: 13px; }

/* 页面骨架 */
.page { max-width: 996px; margin: 0 auto; padding: 36px 48px 96px; }
.page-emoji { font-size: 56px; line-height: 1.1; margin-bottom: 10px; }
.h1 { margin: 0; font-size: 40px; line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
.sub { margin-top: 6px; color: var(--fg2); font-size: 15px; line-height: 1.5; }
.callout { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 14px; border-radius: 6px; font-size: 14px; }
.tabs { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--line); height: 38px; }
.th { display: flex; align-items: center; gap: 6px; padding: 0 8px; border-right: 1px solid var(--line); color: var(--fg2); font-size: 13px; }
.th i { font-size: 15px; }
.td { display: flex; align-items: center; padding: 0 8px; border-right: 1px solid var(--line); min-width: 0; }
.trow { display: grid; min-height: 40px; border-bottom: 1px solid var(--line); }
.trow:hover { background: var(--hover); }
.thead { display: grid; height: 34px; border-bottom: 1px solid var(--line); }
.empty { padding: 72px 0; text-align: center; color: var(--fg3); font-size: 14px; }

/* 弹层 */
.scrim { position: absolute; inset: 0; z-index: 90; background: var(--scrim); display: flex; align-items: center; justify-content: center; }
.dialog { border-radius: 8px; background: var(--pop); box-shadow: var(--pop-shadow); }
.menu { position: absolute; z-index: 20; padding: 4px; border-radius: 8px; background: var(--pop); box-shadow: var(--pop-shadow); }
.menu-item { width: 100%; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: none; border-radius: 4px; background: transparent; color: var(--fg); text-align: left; cursor: pointer; }
.menu-item:hover, .menu-item.on { background: var(--hover); }
.menu-icon { width: 32px; height: 32px; flex-shrink: 0; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--line); display: flex; align-items: center; justify-content: center; background: var(--bg); color: var(--fg2); }
.toast { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 14px; border-radius: 6px; background: var(--toast); color: #fff; font-size: 14px; box-shadow: 0 4px 12px rgba(15,15,15,.2); white-space: nowrap; animation: sa-up .18s ease-out; }
.toast button { height: 26px; padding: 0 8px; border: none; border-radius: 4px; background: transparent; color: #fff; cursor: pointer; }
.toast button:hover { background: rgba(255,255,255,.1); }
.toast .act { font-weight: 600; text-decoration: underline; text-decoration-color: rgba(255,255,255,.4); text-underline-offset: 3px; }

/* ---------- 管理后台（管理员在侧边栏进入，页面在 js/admin/） ---------- */
.page.wide { max-width: 1180px; }
.stat { flex: 1; min-width: 0; padding: 14px 16px; border-radius: 8px; background: var(--canvas); }
.stat .n { font-size: 26px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; text-align: right; justify-content: flex-end; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 560px; max-width: 100%; z-index: 40; display: flex; flex-direction: column;
  background: var(--bg); box-shadow: var(--pop-shadow); animation: sa-in .18s ease-out; }
.field-row { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.field-row > label { font-size: 13px; color: var(--fg2); }
.input { height: 32px; padding: 0 10px; font-size: 14px; border: none; outline: none; width: 100%; }
textarea.input { height: auto; min-height: 120px; padding: 8px 10px; line-height: 1.6; resize: vertical; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 13px; border: 1px solid var(--line-in);
  background: transparent; color: var(--fg2); font-size: 13px; cursor: pointer; }
.pill.on { border-color: var(--fg); color: var(--fg); }
.pill:disabled { opacity: .5; cursor: default; }
/* AI改写的建议卡片：白底圆角，一行一个建议，右侧箭头 */
.rw-card { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 14px 0 16px; border: none; border-radius: 8px;
  background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-in); color: var(--fg); font-size: 15px; cursor: pointer; transition: background .12s; }
.rw-card:hover:not(:disabled) { background: var(--canvas); }
.rw-card:disabled { opacity: .5; cursor: default; }
.mono-sm { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 12px; }

/* macOS 桌面端：标题栏透明，顶部 38 像素那条左边是红绿灯（全屏时没有）；那条的空白处可以拖动窗口，不选中文字 */
.mac-top { padding-left: 80px; }
html.fullscreen .mac-top { padding-left: 10px; }
[data-drag] { -webkit-user-select: none; user-select: none; }

/* 发布台的稿件表格：组宽够就全列；窗口窄（组宽不到 1080）收掉「结果」列（结果挪到状态下面）、操作按钮只留短字 */
.desk-group { container-type: inline-size; }
.desk-group > .trow:last-child { border-bottom: none; border-radius: 0 0 8px 8px; }
.desk-grid { grid-template-columns: 20px 28px 48px minmax(150px, 1fr) 92px 118px 176px 150px 104px 176px; }
.desk-grid .c-res-inline, .desk-grid .lbl-short { display: none; }
@container (max-width: 1080px) {
  .desk-grid { grid-template-columns: 20px 28px 44px minmax(100px, 1fr) 72px 104px 120px 76px 120px; }
  .desk-grid .c-res { display: none; }
  .desk-grid .c-res-inline { display: flex; }
  .desk-grid .lbl-long { display: none; }
  .desk-grid .lbl-short { display: inline; }
}

