/* ============================================================
   首页 · 登录 · 工作台（与编辑器同一套色板：浅灰底、白色胶囊、深色主按钮）
   ============================================================ */
:root {
  --bg: #EBEBEB; --surface: #FFFFFF; --ink: #2B2B2B; --ink-strong: #1B1B1B; --ink-2: #6A6A6A; --ink-3: #A0A0A0; --ink-4: #C8C8C8;
  --line: #F0F0F0; --hover: rgba(0, 0, 0, .04); --danger: #CF4238; --ok: #2E9D5B;
  --grad-2: linear-gradient(180deg, #F3F3F3 0%, #F8F8F8 100%);
  --grad-ink: linear-gradient(180deg, #1F1F1F 0%, #3A3A3A 100%);
  --hi: inset 0 0 0 1px rgba(255, 255, 255, .92);
  --sh-chip: 0 0 0 .5px rgba(0, 0, 0, .05), 0 1px 2px rgba(0, 0, 0, .05), 0 3px 8px rgba(0, 0, 0, .03);
  --sh-float: 0 0 0 .5px rgba(0, 0, 0, .05), 0 1px 3px rgba(0, 0, 0, .04), 0 12px 32px rgba(0, 0, 0, .06);
  --sh-pop: 0 0 0 .5px rgba(0, 0, 0, .07), 0 4px 12px rgba(0, 0, 0, .05), 0 24px 64px rgba(0, 0, 0, .14);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; padding: 0; }
[hidden] { display: none !important; }

.btn { height: 36px; padding: 0 16px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--grad-2); box-shadow: var(--hi), var(--sh-chip); font-weight: 500; white-space: nowrap; transition: transform .15s var(--ease), opacity .15s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.primary { background: var(--grad-ink); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.07), var(--sh-chip); }
.btn.danger { color: var(--danger); }
.btn.sm { height: 30px; padding: 0 12px; border-radius: 10px; font-size: 13px; }
.btn.ghost { background: none; box-shadow: none; }
.btn.ghost:hover { background: var(--hover); transform: none; }

.field { display: grid; gap: 6px; }
.field label { font-size: 12px; color: var(--ink-2); }
.input { height: 40px; padding: 0 12px; border-radius: 12px; border: 0; background: var(--surface); box-shadow: 0 0 0 1px rgba(0,0,0,.08); outline: none; transition: box-shadow .15s; width: 100%; }
textarea.input { height: auto; min-height: 72px; padding: 10px 12px; resize: vertical; }
.input:focus { box-shadow: 0 0 0 1px rgba(0,0,0,.25), 0 0 0 4px rgba(0,0,0,.05); }

.mark { width: 28px; height: 28px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #5a5a5a, #111 70%); box-shadow: inset 0 -2px 4px rgba(255,255,255,.12); flex: none; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; letter-spacing: -.01em; color: var(--ink-strong); }

/* ---------- 首页 ---------- */
.landing { min-height: 100vh; display: flex; flex-direction: column; }
.l-top { display: flex; align-items: center; justify-content: space-between; padding: 22px 32px; }
.l-hero { flex: 1; display: grid; place-items: center; text-align: center; padding: 40px 24px 80px; }
.l-hero h1 { font-size: clamp(36px, 6vw, 64px); line-height: 1.08; letter-spacing: -.03em; margin: 0 0 18px; color: var(--ink-strong); font-weight: 650; }
.l-hero p { font-size: 17px; color: var(--ink-2); max-width: 560px; margin: 0 auto 32px; }
.l-hero .btn { height: 44px; padding: 0 22px; border-radius: 14px; font-size: 15px; }
.l-feats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; max-width: 980px; margin: 56px auto 0; text-align: left; }
.l-feat { background: var(--surface); border-radius: 18px; padding: 18px 18px 20px; box-shadow: var(--sh-chip); }
.l-feat b { display: block; margin-bottom: 4px; color: var(--ink-strong); }
.l-feat span { color: var(--ink-2); font-size: 13px; }

/* ---------- 登录 ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border-radius: 24px; box-shadow: var(--sh-float); padding: 30px 28px 26px; display: grid; gap: 16px; }
.auth-card h2 { margin: 6px 0 0; font-size: 22px; letter-spacing: -.02em; color: var(--ink-strong); }
.auth-card .btn.primary { height: 42px; width: 100%; }
.auth-switch { text-align: center; font-size: 13px; color: var(--ink-2); }
.auth-switch button { color: var(--ink-strong); font-weight: 600; }
.err { color: var(--danger); font-size: 13px; min-height: 18px; }

/* ---------- 工作台 ---------- */
.wb { display: grid; grid-template-columns: 228px 1fr; min-height: 100vh; }
.wb-side { position: sticky; top: 0; height: 100vh; padding: 20px 14px; display: flex; flex-direction: column; gap: 4px; }
.wb-side .brand { padding: 0 8px 18px; }
.nav-item { height: 38px; padding: 0 12px; border-radius: 11px; display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-weight: 500; text-align: left; width: 100%; transition: background .15s, color .15s; }
.nav-item:hover { background: var(--hover); color: var(--ink); }
.nav-item.on { background: var(--surface); color: var(--ink-strong); box-shadow: var(--sh-chip); }
.nav-item .n { margin-left: auto; font-size: 12px; color: var(--ink-3); font-weight: 400; }
.nav-item .dot { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; display: grid; place-items: center; }
.wb-side .spacer { flex: 1; }
.me { display: flex; align-items: center; gap: 10px; padding: 10px 8px 0; border-top: 1px solid rgba(0,0,0,.06); margin-top: 8px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 600; box-shadow: var(--sh-chip); flex: none; }
.me .who { flex: 1; min-width: 0; font-size: 13px; line-height: 1.25; }
.me .who small { color: var(--ink-3); display: block; }

.wb-main { padding: 28px 36px 60px; min-width: 0; }
.wb-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; min-height: 40px; }
.wb-head h1 { font-size: 24px; letter-spacing: -.02em; margin: 0; color: var(--ink-strong); }
.wb-head .sub { color: var(--ink-3); font-size: 13px; }
.wb-head .right { margin-left: auto; display: flex; gap: 8px; }
.section-title { font-size: 13px; color: var(--ink-2); font-weight: 600; margin: 30px 0 12px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.card { background: var(--surface); border-radius: 18px; box-shadow: var(--sh-chip); overflow: hidden; display: flex; flex-direction: column; position: relative; transition: box-shadow .2s, transform .2s var(--ease); }
.card.link { cursor: pointer; }
.card.link:hover { box-shadow: var(--sh-float); transform: translateY(-2px); }
.card .thumb { aspect-ratio: 4 / 3; background: repeating-conic-gradient(#F2F2F2 0% 25%, #FAFAFA 0% 50%) 0 0 / 14px 14px; display: grid; place-items: center; color: var(--ink-4); overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 12px 14px 14px; display: grid; gap: 2px; }
.card .t { font-weight: 600; color: var(--ink-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .m { font-size: 12px; color: var(--ink-3); }
.card .d { font-size: 13px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 0; }
.card .acts { display: flex; gap: 6px; padding: 0 12px 12px; flex-wrap: wrap; }
.card .more { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 9px; background: rgba(255,255,255,.9); box-shadow: var(--sh-chip); display: grid; place-items: center; opacity: 0; transition: opacity .15s; }
.card:hover .more { opacity: 1; }
.card.new { border: 1.5px dashed rgba(0,0,0,.14); background: transparent; box-shadow: none; display: grid; place-items: center; min-height: 160px; color: var(--ink-2); font-weight: 500; }
.card.new:hover { background: rgba(255,255,255,.5); }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11px; background: #F2F2F2; color: var(--ink-2); font-weight: 500; }
.tag.ok { background: #E6F4EC; color: var(--ok); }
.tag.warn { background: #FFF3DD; color: #A36A00; }
.tag.bad { background: #FBE7E5; color: var(--danger); }
.tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }

.empty { padding: 40px; text-align: center; color: var(--ink-3); background: rgba(255,255,255,.4); border-radius: 18px; }

.panel { background: var(--surface); border-radius: 20px; box-shadow: var(--sh-chip); padding: 18px 20px; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.file { border-radius: 12px; background: #F6F6F6; overflow: hidden; position: relative; }
.file .ph { aspect-ratio: 1; display: grid; place-items: center; color: var(--ink-3); font-size: 12px; padding: 8px; text-align: center; word-break: break-all; }
.file img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.file .x { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 8px; background: rgba(255,255,255,.92); display: grid; place-items: center; opacity: 0; transition: opacity .15s; color: var(--danger); }
.file:hover .x { opacity: 1; }
.file .cap { font-size: 12px; padding: 6px 8px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drop-zone { border: 1.5px dashed rgba(0,0,0,.15); border-radius: 14px; padding: 18px; text-align: center; color: var(--ink-2); cursor: pointer; transition: background .15s; }
.drop-zone:hover, .drop-zone.over { background: #F6F6F6; }

.list { display: grid; gap: 8px; }
.row { background: var(--surface); border-radius: 14px; box-shadow: var(--sh-chip); padding: 12px 16px; display: flex; gap: 12px; align-items: center; }
.row.unread { box-shadow: inset 3px 0 0 var(--ink-strong), var(--sh-chip); }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 600; color: var(--ink-strong); }
.row .m { font-size: 12px; color: var(--ink-3); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; color: var(--ink-3); font-weight: 500; padding: 8px 10px; }
.tbl td { padding: 9px 10px; border-top: 1px solid var(--line); }

/* 弹层 */
.modal { position: fixed; inset: 0; background: rgba(20,20,20,.18); display: grid; place-items: center; z-index: 50; padding: 20px; animation: fade .2s; }
.modal-card { width: 100%; max-width: 440px; background: var(--surface); border-radius: 22px; box-shadow: var(--sh-pop); padding: 22px; display: grid; gap: 14px; animation: rise .25s var(--ease); max-height: 86vh; overflow: auto; }
.modal-card.wide { max-width: 640px; }
.modal-card h3 { margin: 0; font-size: 17px; color: var(--ink-strong); }
.modal-card .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.users-pick { max-height: 240px; overflow: auto; display: grid; gap: 4px; padding: 4px; background: #F7F7F7; border-radius: 12px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--ink-strong); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .3s var(--ease); z-index: 60; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 760px) {
  .wb { grid-template-columns: 1fr; }
  .wb-side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; padding: 12px; }
  .wb-side .brand, .wb-side .spacer { display: none; }
  .nav-item { width: auto; }
  .wb-main { padding: 18px; }
}

/* ---------- 作品（功能历史，按天）：直角、细线、图为主 ---------- */
.hx-filter { height: 32px; padding: 0 28px 0 10px; border: 1px solid rgba(0,0,0,.14); border-radius: 0; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236A6A6A' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat right 10px center;
  -webkit-appearance: none; appearance: none; font-size: 13px; color: var(--ink); cursor: pointer; outline: none; }
.hx-filter:hover, .hx-filter:focus { border-color: var(--ink-strong); }
.hx-btn { height: 32px; padding: 0 14px; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; border: 1px solid var(--ink-strong); }
.hx-btn.primary { background: var(--ink-strong); color: #fff; }
.hx-btn.primary:hover { background: #000; }

.hx-day { margin-bottom: 36px; }
.hx-day h2 { position: sticky; top: 0; z-index: 2; margin: 0; padding: 14px 0 10px; display: flex; align-items: baseline; gap: 10px; background: var(--bg);
  font-size: 13px; font-weight: 400; border-bottom: 1px solid var(--ink-strong); }
.hx-day h2 b { font-size: 15px; font-weight: 600; color: var(--ink-strong); }
.hx-day h2 span { color: var(--ink-3); }
.hx-day h2 i { margin-left: auto; font-style: normal; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.hx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); border-left: 1px solid rgba(0,0,0,.1); }
.hx-tile { position: relative; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid rgba(0,0,0,.1); border-bottom: 1px solid rgba(0,0,0,.1); min-width: 0; }
.hx-tile::after { content: ''; position: absolute; inset: -1px 0 0 -1px; border: 1px solid var(--ink-strong); opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 1; }
.hx-tile:hover::after, .hx-tile:focus-visible::after { opacity: 1; }
.hx-tile:focus-visible { outline: none; }
.hx-img { aspect-ratio: 1; background: #F4F4F4; overflow: hidden; display: block; }
.hx-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s var(--ease); }
.hx-tile:hover .hx-img img { transform: scale(1.03); }
.hx-cap { display: flex; align-items: baseline; gap: 8px; padding: 9px 12px 0; font-size: 13px; }
.hx-cap b { font-weight: 600; color: var(--ink-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hx-cap time { margin-left: auto; flex: none; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.hx-sub { padding: 1px 12px 0; font-size: 12px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hx-tile > :last-child { padding-bottom: 10px; }

.hx-foot { display: flex; justify-content: center; padding: 4px 0 20px; }
.hx-more { height: 36px; padding: 0 22px; border: 1px solid rgba(0,0,0,.18); background: var(--surface); font-size: 13px; color: var(--ink-2); display: inline-flex; align-items: center; }
button.hx-more:hover { border-color: var(--ink-strong); color: var(--ink-strong); }
.hx-more.is-busy { border-color: transparent; background: none; color: var(--ink-3); }
.hx-empty { padding: 72px 20px; text-align: center; color: var(--ink-strong); border: 1px solid rgba(0,0,0,.1); background: var(--surface); line-height: 1.9; }
.hx-empty span { color: var(--ink-3); font-size: 13px; }
