  :root {
    --bg: #f6f7fb; --card: #ffffff; --ink: #1f2330; --muted: #8b90a0;
    --line: #ececf2; --brand: #4f46e5; --brand-soft: #eef0fe;
    --green: #16a34a; --yellow: #d97706; --grey: #c2c6d2;
    --radius: 16px; --shadow: 0 6px 24px rgba(31,35,48,.06);
    --side-w: 208px;
  }
  body.dark {
    --bg: #13141a; --card: #1c1e27; --ink: #e7e8ef; --muted: #8a8fa3;
    --line: #2a2d3a; --brand: #8b86ff; --brand-soft: #26243a;
    --shadow: 0 6px 24px rgba(0,0,0,.4);
  }
  * { box-sizing: border-box; }
  body {
    margin: 0; background: var(--bg); color: var(--ink);
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    line-height: 1.55;
  }
  .layout { display: flex; min-height: 100vh; }

  /* ===== 侧边栏 ===== */
  .sidebar {
    width: var(--side-w); flex: none; background: var(--card);
    border-right: 1px solid var(--line); padding: 16px 12px;
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
  }
  .brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 16px; }
  .brand .mark {
    width: 30px; height: 30px; border-radius: 9px; background: var(--brand);
    color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px;
  }
  .brand .name { font-weight: 700; font-size: 15px; letter-spacing: .3px; }
  .nav { display: flex; flex-direction: column; gap: 3px; }
  .nav-item {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px;
    border-radius: 9px; cursor: pointer; color: var(--muted);
    font-size: 13.5px; font-weight: 500; transition: background .12s, color .12s;
  }
  .nav-item svg { width: 18px; height: 18px; }
  .nav-item:hover { background: var(--bg); color: var(--ink); }
  .nav-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
  .nav-sep { height: 1px; background: var(--line); margin: 10px 6px; }
  .side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 8px; border-top: 1px solid var(--line); }
  .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 600; flex: none; }
  .side-foot .who { font-size: 13px; }
  .side-foot .who small { display: block; color: var(--muted); font-size: 11px; }

  /* ===== 内容区 ===== */
  .content { flex: 1; min-width: 0; }
  .topbar {
    display: flex; align-items: center; gap: 16px; padding: 12px 28px;
    border-bottom: 1px solid var(--line); background: var(--card);
  }
  .topbar h2 { margin: 0; font-size: 17px; }
  .topbar .crumb { color: var(--muted); font-size: 12px; margin-top: 1px; }
  .search {
    margin-left: auto; padding: 7px 13px; border: 1px solid var(--line);
    border-radius: 9px; font-size: 13px; width: 220px; outline: none; background: var(--bg); color: var(--ink);
  }
  .search:focus { border-color: var(--brand); }
  .view { display: none; padding: 22px 28px 50px; max-width: 1340px; }
  .view.active { display: block; }
.aichat-wrap { max-width: 1000px; margin: 0 auto; display: flex; flex-direction: column; height: calc(100vh - 150px); }
.aichat-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.aichat-head h2 { font-size: 18px; margin: 0; }
.aichat-opts { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }
.aichat-opts input { padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); }
.aichat-log { flex: 1; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; padding: 16px; background: var(--bg); display: flex; flex-direction: column; gap: 14px; }
.ai-msg { max-width: 92%; padding: 10px 14px; border-radius: 12px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.ai-msg.user { align-self: flex-end; background: var(--brand); color: #fff; }
.ai-msg.assistant { align-self: flex-start; background: var(--card, #fff); border: 1px solid var(--line); }
.ai-think { font-size: 12px; color: var(--muted); border-left: 2px solid var(--line); padding-left: 8px; margin-bottom: 6px; white-space: pre-wrap; }
.ai-text { white-space: pre-wrap; }
.aichat-input { display: flex; gap: 10px; margin-top: 12px; }
.aichat-input textarea { flex: 1; resize: vertical; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font-family: inherit; }
.aichat-input button { padding: 0 22px; border: none; border-radius: 10px; background: var(--brand); color: #fff; cursor: pointer; font-size: 14px; }
  .section-title { font-size: 13px; color: var(--muted); font-weight: 600; margin: 0 0 12px; letter-spacing: 1.5px; }

  /* 概览：左计划 + 右应用（跳转）两栏 */
  .home { display: grid; grid-template-columns: 1fr 330px; gap: 22px; align-items: start; }
  @media (max-width: 820px) { .home { grid-template-columns: 1fr; } .home-side { border-left: none; padding-left: 0; border-top: 1px solid var(--line); padding-top: 22px; } }
  .home-main { min-width: 0; }
  .home-side { border-left: 1px solid var(--line); padding-left: 22px; }
  .block-h { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 0 0 12px; }
  .block-h svg { width: 17px; height: 17px; color: var(--brand); }
  .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-bottom: 30px; }
  .grid-side { grid-template-columns: 1fr; margin-bottom: 0; }
  .grid-side .app-card { padding: 14px; }
  .grid-side .app-card .top { margin-bottom: 8px; }
  .grid-side .icon { width: 36px; height: 36px; border-radius: 10px; }
  .grid-side .icon svg { width: 19px; height: 19px; }

  .app-card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 18px; box-shadow: var(--shadow); text-decoration: none; color: inherit;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; display: block;
  }
  .app-card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(31,35,48,.10); border-color: #d9d9f0; }
  .app-card .top { display: flex; align-items: center; gap: 13px; margin-bottom: 12px; }
  .icon { width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
  .icon svg { width: 23px; height: 23px; }
  .app-card .name { font-weight: 650; font-size: 15px; }
  .app-card .desc { color: var(--muted); font-size: 13px; }
  .badge { margin-left: auto; font-size: 11px; padding: 3px 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-weight: 500; }
  .status { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); margin-top: 10px; }
  .dot { width: 8px; height: 8px; border-radius: 50%; }
  .dot.up { background: var(--green); } .dot.slow { background: var(--yellow); }
  .dot.down { background: var(--grey); } .dot.plan { background: var(--grey); opacity: .5; }
  .app-card.plan { opacity: .62; }

  .chips { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
  .chip { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font-size: 13px; cursor: pointer; }
  .chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }

  .panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
  .panel h3 { margin: 0 0 14px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
  .panel h3 svg { width: 17px; height: 17px; color: var(--brand); }
  .add-row { display: flex; gap: 8px; margin-bottom: 14px; }
  .add-row input { flex: 1; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; outline: none; background: var(--bg); color: var(--ink); }
  .add-row input:focus { border-color: var(--brand); }
  button { border: 1px solid var(--line); cursor: pointer; font-size: 14px; border-radius: 10px; padding: 8px 15px; background: var(--card); color: var(--ink); font-weight: 500; transition: background .12s, border-color .12s, color .12s; }
  button:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
  button.ghost { background: transparent; color: var(--muted); border-color: var(--line); }
  button.ghost:hover { color: var(--brand); border-color: var(--brand); background: transparent; }
  button:disabled { opacity: .55; cursor: default; }
  .logout-btn { font-size: 12px; padding: 5px 11px; margin-left: auto; }
  .login-row { display: flex; gap: 8px; align-items: center; }
  .login-row input { width: 150px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 13px; outline: none; background: var(--bg); color: var(--ink); }
  .login-row input:focus { border-color: var(--brand); }
  ul.todo { list-style: none; padding: 0; margin: 0; }
  ul.todo li { display: flex; align-items: center; gap: 9px; padding: 6px 4px; border-bottom: 1px solid var(--line); font-size: 13px; }
  ul.todo li:last-child { border-bottom: none; }
  ul.todo li.done .txt { color: var(--muted); text-decoration: line-through; }
  ul.todo .del { margin-left: auto; color: var(--grey); cursor: pointer; font-size: 15px; }
  ul.todo .del:hover { color: #e0524d; }

  /* 按项目分组的日计划（紧凑网格卡片） */
  #projectsBox, #projectsBoxOv { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; align-items: start; }
  .proj { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; margin-bottom: 0; box-shadow: var(--shadow); }
  #projectsBoxOv .proj { background: var(--bg); box-shadow: none; }
  body.dark #projectsBoxOv .proj { background: #1a1c25; }
  .proj-head { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
  .proj-head b { font-size: 14px; }
  .proj-name { font-size: 14px; font-weight: 600; flex: 1 1 auto; min-width: 0; cursor: text; outline: none; border-radius: 5px; padding: 1px 4px; margin: -1px -4px; line-height: 1.4; }
  .proj-name:hover { background: var(--brand-soft); }
  .proj-name:focus { background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand); }
  .drag-handle { cursor: grab; color: var(--grey); font-size: 16px; line-height: 1; user-select: none; flex: none; }
  .drag-handle:active { cursor: grabbing; }
  .proj.dragging { opacity: .4; }
  .proj.drag-over { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
  .proj-count { font-size: 12px; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; }
  #projectsBoxOv .proj-count { background: var(--card); }
  .proj-head .del { margin-left: auto; color: var(--grey); cursor: pointer; font-size: 12px; }
  .proj-head .del:hover { color: #e0524d; }
  .proj .add-row { margin: 2px 0 10px; }
  .hint { color: var(--muted); font-size: 12px; margin-top: 12px; }

  /* 表单输入 */
  textarea { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13px; font-family: inherit; outline: none; background: var(--bg); color: var(--ink); resize: vertical; box-sizing: border-box; }
  textarea:focus { border-color: var(--brand); }
  .cs-tabs { display: flex; gap: 0; margin-bottom: 20px; }
  .cs-tab { padding: 8px 20px; font-size: 14px; cursor: pointer; border: 1px solid var(--line); margin-right: -1px; background: var(--bg); color: var(--muted); }
  .cs-tab:first-child { border-radius: 10px 0 0 10px; }
  .cs-tab:last-child { border-radius: 0 10px 10px 0; }
  .cs-tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }
  .cs-panel { display: none; }
  .cs-panel.active { display: block; }
  .cs-chk { font-size: 13px; display: flex; align-items: center; gap: 5px; cursor: pointer; color: var(--ink); }
  .cs-chk input { width: 14px; height: 14px; accent-color: var(--brand); }
    /* 监控 */
  .dash { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
  .dash-wide { grid-column: 1 / -1; }
  @media (max-width: 820px) { .dash { grid-template-columns: 1fr; } }
  .dash-card { margin-bottom: 0; }
  .dash-card h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 0 0 14px; }
  .dash-card h3 svg { width: 17px; height: 17px; color: var(--brand); }
  .stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
  .stat-grid .cell { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
  body.dark .stat-grid .cell { background: #1a1c25; }
  .stat-grid .num { font-size: 22px; font-weight: 700; color: var(--brand); }
  .stat-grid .lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }
  .review-text { margin-top: 14px; font-size: 14px; line-height: 1.7; white-space: pre-wrap; color: var(--ink); background: var(--brand-soft); border-radius: 10px; padding: 12px 14px; }
  .dash-card .hint { color: var(--muted); font-size: 13px; }
  .win-line { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
  .win-line:last-child { border-bottom: none; }
  .win-line .k { color: var(--muted); }
  .win-line .v { font-weight: 600; text-align: right; }
  .win-sub { font-size: 12px; color: var(--muted); margin: 10px 0 4px; font-weight: 600; }

  /* 自动化任务 */
  .ajob { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .ajob:last-child { border-bottom: none; }
  .ajob.off { opacity: .55; }
  .aj-info { flex: 1; min-width: 0; }
  .aj-name { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 6px; flex-wrap: wrap; }
  .aj-name b { font-weight: 600; }
  .pill { display: inline-block; font-size: 11px; line-height: 1; padding: 4px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
  .pill.on { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
  body.dark .pill { background: #1a1c25; }
  body.dark .pill.on { background: #14532d; color: #86efac; border-color: #166534; }
  .aj-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); }
  .aj-meta .kv { white-space: nowrap; }
  .aj-meta .kv i { color: var(--muted); font-style: normal; margin-right: 4px; opacity: .75; }
  .aj-last { margin-top: 6px; font-size: 12px; color: var(--ink); display: flex; align-items: center; gap: 6px; line-height: 1.5; word-break: break-word; }
  .aj-last .badge { font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: 600; flex-shrink: 0; }
  .aj-last .badge.ok { background: #dcfce7; color: #15803d; }
  .aj-last .badge.fail { background: #fee2e2; color: #b91c1c; }
  .aj-last .badge.skip { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
  body.dark .aj-last .badge.ok { background: #14532d; color: #86efac; }
  body.dark .aj-last .badge.fail { background: #7f1d1d; color: #fca5a5; }
  .dot2 { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
  .dot2.up { background: #16a34a; }
  .aj-acts { display: flex; gap: 8px; flex-shrink: 0; }
  .aj-acts button { padding: 6px 14px; font-size: 13px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
  .aj-acts button:hover { background: var(--brand-soft); }
  .aj-acts button:disabled { opacity: .35; cursor: not-allowed; }
  @media (max-width: 520px) {
    .ajob { flex-direction: column; align-items: stretch; }
    .aj-acts { justify-content: flex-end; }
  }
  .stat-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); margin-bottom: 10px; }
  .stat-row .n { font-weight: 600; }
  .stat-row .d { color: var(--muted); font-size: 13px; flex: 1; }
  .stat-row a { color: var(--brand); font-size: 13px; text-decoration: none; }

  /* 设置 */
  .set-row { display: flex; align-items: center; justify-content: space-between; padding: 16px 4px; border-bottom: 1px solid var(--line); }
  .set-row:last-child { border-bottom: none; }
  .set-row .t { font-weight: 600; font-size: 14px; }
  .set-row .s { color: var(--muted); font-size: 13px; }
  .bookmarklet { display: inline-block; padding: 8px 16px; border-radius: 10px; background: var(--brand); color: #fff; font-size: 13px; font-weight: 600; text-decoration: none; cursor: grab; white-space: nowrap; flex: none; }
  .bookmarklet:active { cursor: grabbing; }
  .switch { width: 46px; height: 26px; border-radius: 999px; background: var(--grey); position: relative; cursor: pointer; transition: background .15s; flex: none; }
  .switch.on { background: var(--brand); }
  .switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
  .switch.on::after { transform: translateX(20px); }

  /* 收藏模块 */
  .coll-toolbar { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; }
  .coll-toolbar input { flex: 1; padding: 9px 14px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; outline: none; background: var(--bg); color: var(--ink); }
  .coll-toolbar input:focus { border-color: var(--brand); }
  .coll-form { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); margin-bottom: 20px; }
  .coll-form .row { display: flex; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
  .coll-form input, .coll-form select, .coll-form textarea {
    padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px;
    outline: none; background: var(--bg); color: var(--ink); font-family: inherit;
  }
  .coll-form input:focus, .coll-form select:focus, .coll-form textarea:focus { border-color: var(--brand); }
  .coll-form .title { flex: 1; min-width: 200px; }
  .coll-form .url { flex: 1; min-width: 200px; }
  .coll-form .full { width: 100%; }
  .coll-form textarea { width: 100%; min-height: 60px; resize: vertical; }
  .coll-form .actions { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
  .bm-hint { color: var(--muted); font-size: 12px; margin-left: auto; }
  .bm-hint a { color: var(--brand); text-decoration: none; font-weight: 600; }
  .coll-grid { display: flex; flex-direction: column; gap: 12px; }
  .coll-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow); }
  .coll-card .head { display: flex; align-items: center; gap: 10px; }
  .coll-card .ctype { width: 30px; height: 30px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
  .coll-card .ctype svg { width: 17px; height: 17px; }
  .coll-card .ttl { font-weight: 600; font-size: 15px; flex: 1; cursor: pointer; }
  .coll-card .ttl:hover { color: var(--brand); }
  .coll-card .b { font-size: 11px; padding: 3px 9px; border-radius: 999px; font-weight: 500; }
  .coll-card .b.type { background: var(--brand-soft); color: var(--brand); }
  .coll-card .b.st { background: #f1f3f7; color: var(--muted); }
  body.dark .coll-card .b.st { background: #26283a; }
  .coll-card .b.st.want { color: #d97706; background: #fef3e2; }
  .coll-card .b.st.kept { color: #16a34a; background: #e7f6ec; }
  body.dark .coll-card .b.st.want { background: #2a2419; }
  body.dark .coll-card .b.st.kept { background: #19271f; }
  .coll-card .note { color: var(--ink); font-size: 13px; margin: 10px 0 8px; white-space: pre-wrap; }
  .coll-card .tags { display: flex; gap: 6px; flex-wrap: wrap; }
  .coll-card .tag { font-size: 12px; color: var(--muted); background: var(--bg); border-radius: 6px; padding: 2px 8px; }
  .coll-card .meta { display: flex; align-items: center; gap: 14px; margin-top: 10px; flex-wrap: wrap; }
  .coll-card .meta a { color: var(--brand); font-size: 13px; text-decoration: none; }
  .coll-card .del { margin-left: auto; color: var(--grey); cursor: pointer; }
  .coll-card .del:hover { color: #e0524d; }
  .coll-card .toplan { color: var(--brand); cursor: pointer; font-size: 13px; }
  .coll-card .toplan:hover { text-decoration: underline; }
  #toast { position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--card); padding: 10px 18px; border-radius: 10px; font-size: 13px; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; z-index: 99; }
  #toast.show { opacity: .94; transform: translateX(-50%) translateY(0); }
  .coll-card .summary { background: var(--brand-soft); color: var(--ink); font-size: 13px; border-radius: 10px; padding: 10px 12px; margin: 10px 0 8px; line-height: 1.6; white-space: pre-wrap; }
  .coll-card .summary.summarizing { color: var(--muted); }
  .ai-badge { display: inline-block; font-size: 11px; font-weight: 600; color: var(--brand); background: var(--card); border: 1px solid var(--brand); border-radius: 6px; padding: 1px 7px; margin-right: 8px; }
  .sum-btn { font-size: 12px; padding: 6px 12px; margin: 8px 0 2px; }
  .loading { color: var(--muted); font-size: 13px; padding: 20px 0; }

  /* 登录遮罩 */
  .login-mask { position: fixed; inset: 0; background: rgba(20,22,30,.5); backdrop-filter: blur(5px); display: grid; place-items: center; z-index: 1000; }
  .login-box { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 30px 30px 26px; width: 320px; box-shadow: var(--shadow); }
  .login-box .add-row input { background: var(--bg); }
  .login-err { color: #e0524d; font-size: 13px; min-height: 18px; margin: 0 0 10px; }

  /* 自定义确认弹窗（系统风格） */
  .confirm-mask { position: fixed; inset: 0; background: rgba(20,22,30,.5); backdrop-filter: blur(5px); display: grid; place-items: center; z-index: 1000; }
  .confirm-box { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 26px 26px 22px; width: 340px; box-shadow: var(--shadow); }
  .confirm-box .msg { font-size: 15px; line-height: 1.6; margin: 6px 0 22px; color: var(--ink); }
  .confirm-box .actions { display: flex; gap: 10px; justify-content: flex-end; }
  .btn-danger { border-color: #f0c4c2; color: #e0524d; }
  .btn-danger:hover { background: #e0524d; border-color: #e0524d; color: #fff; }


/* ---------- 安全值班 ---------- */
.duty-wrap { padding: 22px; display: flex; flex-direction: column; gap: 18px; }
.duty-hero { background: linear-gradient(135deg, #0e2a4d, #13456f); color: #fff; border-radius: 14px; padding: 20px 24px; box-shadow: 0 4px 14px rgba(14,42,77,.18); }
.duty-hero-kicker { font-size: 13px; opacity: .75; letter-spacing: 1px; }
.duty-hero-main { margin-top: 8px; min-height: 28px; font-size: 19px; font-weight: 500; }
.duty-hero-main b { font-size: 24px; font-weight: 700; }
.duty-hero-next { margin-top: 8px; font-size: 13px; opacity: .9; }
.duty-cards { display: flex; gap: 18px; flex-wrap: wrap; }
.duty-week { flex: 1 1 380px; background: var(--card, #fff); border: 1px solid var(--border, #e5e7eb); border-radius: 14px; padding: 16px 18px; min-width: 0; }
.duty-week-title { font-weight: 600; margin-bottom: 14px; font-size: 15px; }
.duty-block { margin-bottom: 14px; }
.duty-block-head { font-size: 12px; font-weight: 600; color: var(--muted, #6b7280); margin-bottom: 8px; letter-spacing: .5px; }
.duty-block-head span { font-weight: 400; opacity: .75; }
.duty-item { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 7px 10px; border-radius: 8px; margin-bottom: 6px; line-height: 1.4; }
.duty-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.duty-item.monitor .duty-dot { background: #2563eb; }
.duty-item.weekly .duty-dot { background: #7c3aed; }
.duty-item.audit .duty-dot { background: #ea580c; }
.duty-item.threat .duty-dot { background: #dc2626; }
.duty-item.rest .duty-dot { background: #16a34a; }
.duty-item.monitor { background: #eff6ff; color: #1d4ed8; }
.duty-item.weekly { background: #f5f3ff; color: #6d28d9; }
.duty-item.audit { background: #fff7ed; color: #c2410c; }
.duty-item.threat { background: #fef2f2; color: #b91c1c; }
.duty-item.rest { background: #f0fdf4; color: #15803d; }
.duty-item.none { background: transparent; color: var(--muted, #9ca3af); }
.duty-chip { display: inline-block; padding: 5px 14px; border-radius: 999px; font-size: 15px; }
.duty-chip.monitor { background: #2563eb; color: #fff; }
body.dark .duty-item.monitor { background: #1e3a5f; color: #93c5fd; }
body.dark .duty-item.weekly { background: #3b2f63; color: #c4b5fd; }
body.dark .duty-item.audit { background: #5f3b1e; color: #fdba74; }
body.dark .duty-item.threat { background: #5f1e1e; color: #fca5a5; }
body.dark .duty-item.rest { background: #1e3a2c; color: #86efac; }
body.dark .duty-chip.monitor { background: #2563eb; color: #fff; }

.duty-rotate { font-weight: 600; font-size: 14px; }
.duty-chip.weekly { background: #7c3aed; color: #fff; }
.duty-chip.audit { background: #ea580c; color: #fff; }
.duty-chip.threat { background: #dc2626; color: #fff; }
.duty-chip.rest { background: #16a34a; color: #fff; }

.duty-summary { margin-top: 18px; background: var(--card, #fff); border: 1px solid var(--border, #e5e7eb); border-radius: 14px; padding: 16px 20px; }
.duty-summary-head { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; margin-bottom: 12px; }
.duty-summary-head svg { width: 18px; height: 18px; color: #2563eb; }
.duty-sum-more { margin-left: auto; font-size: 12px; font-weight: 400; color: #2563eb; cursor: pointer; opacity: .85; }
.duty-sum-more:hover { opacity: 1; text-decoration: underline; }
.duty-sum-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; font-size: 13px; flex-wrap: wrap; }
.duty-sum-row:last-child { margin-bottom: 0; }
.duty-sum-label { color: var(--muted, #6b7280); width: 72px; flex-shrink: 0; font-size: 12px; }
.duty-sum-alert { margin-bottom: 0; }

/* ---------- GitHub 趋势 ---------- */
.gt-wrap { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.gt-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.gt-toolbar select { padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border,#e5e7eb); background: var(--card,#fff); color: var(--text,#111); font-size: 13px; }
.gt-since { display: flex; border: 1px solid var(--border,#e5e7eb); border-radius: 8px; overflow: hidden; }
.gt-since button { border: 0; background: var(--card,#fff); color: var(--muted,#6b7280); padding: 7px 12px; font-size: 13px; cursor: pointer; }
.gt-since button.on { background: #2563eb; color: #fff; }
.gt-note { font-size: 12px; color: var(--muted,#6b7280); margin-left: auto; }
.gt-list { display: flex; flex-direction: column; gap: 10px; }
.gt-item { background: var(--card,#fff); border: 1px solid var(--border,#e5e7eb); border-radius: 12px; padding: 14px 16px; }
.gt-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gt-rank { font-size: 13px; font-weight: 700; color: var(--muted,#9ca3af); width: 22px; flex-shrink: 0; }
.gt-repo { font-size: 15px; font-weight: 500; color: #2563eb; text-decoration: none; }
.gt-repo:hover { text-decoration: underline; }
.gt-stars { margin-left: auto; font-size: 12px; color: var(--muted,#6b7280); }
.gt-stars em { font-style: normal; color: #16a34a; }
.gt-desc { font-size: 13px; color: var(--muted,#374151); margin-top: 6px; line-height: 1.5; }
body.dark .gt-desc { color: #cbd5e1; }
.gt-meta { margin-top: 6px; }
.gt-lang { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted,#6b7280); }
.gt-lang i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.gt-empty { color: var(--muted,#9ca3af); text-align: center; padding: 40px 0; font-size: 14px; }
.gt-err { color: #dc2626; }

/* ---------- 热点聚合 ---------- */
.hot-wrap { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.hot-chips { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hot-chips button { border: 1px solid var(--border,#e5e7eb); background: var(--card,#fff); color: var(--muted,#6b7280); padding: 7px 14px; border-radius: 999px; font-size: 13px; cursor: pointer; }
.hot-chips button.on { background: #2563eb; border-color: #2563eb; color: #fff; }
.hot-note { font-size: 12px; color: var(--muted,#9ca3af); margin-left: auto; }
.hot-areas { display: flex; flex-direction: column; gap: 16px; }
.hot-area { background: var(--card,#fff); border: 1px solid var(--border,#e5e7eb); border-radius: 12px; padding: 14px 16px; }
.hot-area-title { font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.hot-err { color: #dc2626; font-size: 12px; font-weight: 400; }
.hot-item { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border,#e5e7eb); }
.hot-item:last-child { border-bottom: 0; }
.hot-rank { font-size: 12px; font-weight: 700; color: var(--muted,#9ca3af); width: 20px; flex-shrink: 0; text-align: right; }
.hot-title { font-size: 14px; color: var(--text,#111827); text-decoration: none; flex: 1; line-height: 1.4; }
.hot-title:hover { color: #2563eb; }
.hot-heat { font-size: 12px; color: var(--muted,#9ca3af); flex-shrink: 0; }
.hot-desc { font-size: 12px; color: var(--muted,#6b7280); padding: 0 0 6px 30px; line-height: 1.5; }
.hot-empty { color: var(--muted,#9ca3af); text-align: center; padding: 30px 0; font-size: 14px; }

  /* ===== 每日一句 ===== */
  .quote-card {
    margin-bottom: 16px; padding: 16px 20px; border-radius: 14px;
    background: linear-gradient(135deg, var(--brand-soft, #eef0fe), var(--card, #fff));
    border: 1px solid var(--line, #ececf2);
    display: flex; gap: 12px; align-items: flex-start;
  }
  .quote-mark { font-family: Georgia, "Times New Roman", serif; font-size: 44px; line-height: .75;
    color: var(--brand, #4f46e5); opacity: .32; flex: none; width: 24px; padding-top: 4px; }
  .quote-body { flex: 1; min-width: 0; }
  .quote-text { font-size: 15px; line-height: 1.65; color: var(--ink, #1f2330); font-weight: 500; }
  .quote-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
  .quote-author { font-size: 13px; color: var(--muted, #8b90a0); }
  .quote-author::before { content: "— "; }
  .quote-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
  .quote-actions button {
    border: 1px solid var(--line, #ececf2); background: var(--card, #fff);
    color: var(--muted, #8b90a0); padding: 3px 12px; border-radius: 999px;
    font-size: 12px; cursor: pointer; transition: color .12s, border-color .12s;
  }
  .quote-actions button:hover { color: var(--brand, #4f46e5); border-color: var(--brand, #4f46e5); }
  .quote-attr { font-size: 11px; color: var(--muted, #8b90a0); text-decoration: none; opacity: .65; }
  .quote-attr:hover { opacity: 1; color: var(--brand, #4f46e5); }
  .quote-err { color: #dc2626; font-size: 13px; }

  /* ===== 技术阅读（dev.to） ===== */
  .dv-wrap { display: flex; flex-direction: column; gap: 14px; }
  .dv-chips { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .dv-chips button {
    border: 1px solid var(--line, #ececf2); background: var(--card, #fff);
    color: var(--muted, #8b90a0); padding: 6px 14px; border-radius: 999px;
    font-size: 13px; cursor: pointer; transition: all .12s;
  }
  .dv-chips button.on { background: var(--brand, #4f46e5); border-color: var(--brand, #4f46e5); color: #fff; }
  .dv-note { font-size: 12px; color: var(--muted, #8b90a0); margin-left: auto; }
  .dv-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
  .dv-card {
    background: var(--card, #fff); border: 1px solid var(--line, #ececf2);
    border-radius: 12px; overflow: hidden; display: flex; flex-direction: column;
  }
  .dv-cover { width: 100%; height: 138px; object-fit: cover; background: var(--bg, #f6f7fb); display: block; }
  .dv-inner { padding: 12px 14px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
  .dv-title { font-size: 14px; font-weight: 600; color: var(--ink, #1f2330); text-decoration: none; line-height: 1.45; }
  .dv-title:hover { color: var(--brand, #4f46e5); }
  .dv-desc {
    font-size: 12.5px; color: var(--muted, #8b90a0); line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .dv-tags { display: flex; gap: 6px; flex-wrap: wrap; }
  .dv-tag { font-size: 11px; color: var(--muted, #8b90a0); background: var(--bg, #f6f7fb); border-radius: 4px; padding: 1px 6px; }
  .dv-foot {
    margin-top: auto; display: flex; align-items: center; gap: 8px;
    padding-top: 8px; border-top: 1px dashed var(--line, #ececf2);
    font-size: 12px; color: var(--muted, #8b90a0);
  }
  .dv-avatar { width: 20px; height: 20px; border-radius: 50%; flex: none; }
  .dv-stat { margin-left: auto; display: flex; gap: 9px; }
  .dv-empty { color: var(--muted, #8b90a0); text-align: center; padding: 40px 0; font-size: 14px; grid-column: 1 / -1; }
  .dv-err { color: #dc2626; }
