    :root {
      --bg: #f6f7f8;
      --panel: #ffffff;
      --line: #d8dde3;
      --line-strong: #b8c1cc;
      --text: #17202a;
      --muted: #62707f;
      --accent: #196f84;
      --accent-soft: #e5f3f6;
      --green: #287a4b;
      --amber: #8a5b00;
      --red: #b42318;
      --focus: #0f5e73;
      font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      color: var(--text);
      background: var(--bg);
      font-size: 14px;
      line-height: 1.45;
    }

    header {
      background: #ffffff;
      border-bottom: 1px solid var(--line);
      position: sticky;
      top: 0;
      z-index: 10;
    }

    .shell {
      width: min(1480px, calc(100vw - 32px));
      margin: 0 auto;
    }

    .topbar {
      min-height: 72px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 20px;
    }

    /* 顶栏只剩 头像+标题 与 搜索：标题区可收缩（窄屏省略号），搜索按钮保持原宽 */
    .topbar-title {
      flex: 1 1 auto;
      min-width: 0;
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .toolbar {
      flex: 0 0 auto;
    }

    h1 {
      margin: 0;
      font-size: 22px;
      letter-spacing: 0;
      line-height: 1.2;
      white-space: nowrap;
    }

    .subline {
      margin-top: 6px;
      color: var(--muted);
      font-size: 13px;
    }

    .toolbar {
      display: flex;
      gap: 8px;
      align-items: center;
      flex-wrap: wrap;
      justify-content: flex-end;
    }

    button {
      border: 1px solid var(--line-strong);
      background: #fff;
      color: var(--text);
      min-height: 36px;
      padding: 0 12px;
      border-radius: 6px;
      cursor: pointer;
      font: inherit;
    }

    button:hover {
      border-color: var(--focus);
      color: var(--focus);
    }

    button.primary {
      background: var(--accent);
      border-color: var(--accent);
      color: #fff;
    }

    button.danger {
      color: var(--red);
      border-color: #e4a19b;
    }

    main {
      padding: 20px 0 32px;
    }

    /* 板块按钮在侧边栏里竖排（布局见 shell.css） */
    .tab-button {
      display: flex;
      align-items: center;
      gap: 10px;
      min-height: 42px;
      font-weight: 600;
      background: #fff;
    }

    .tab-button.active {
      background: var(--accent-soft);
      color: var(--focus);
      border-color: var(--focus);
    }

    .tab-icon {
      display: inline-grid;
      place-items: center;
      width: 22px;
      height: 22px;
      border-radius: 50%;
      color: #fff;
      background: var(--accent);
      font-size: 13px;
      line-height: 1;
      flex: 0 0 auto;
    }

    .summary-grid {
      display: grid;
      grid-template-columns: repeat(4, minmax(170px, 1fr));
      gap: 10px;
      margin-bottom: 16px;
    }

    .custom-stat {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 14px;
      margin-bottom: 16px;
      display: grid;
      grid-template-columns: minmax(240px, 1fr) auto minmax(320px, 1.2fr);
      gap: 14px;
      align-items: center;
    }

    .custom-stat h2 {
      margin: 0 0 6px;
      font-size: 16px;
    }

    .selection-tools {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
      justify-content: center;
    }

    .selection-result {
      display: grid;
      grid-template-columns: repeat(4, minmax(70px, 1fr));
      gap: 8px;
    }

    .selection-card {
      border: 1px solid var(--line);
      border-radius: 6px;
      padding: 8px 10px;
      min-height: 58px;
      background: #fafbfc;
    }

    .selection-card span {
      display: block;
      color: var(--muted);
      font-size: 12px;
      margin-bottom: 2px;
    }

    .selection-card strong {
      font-size: 18px;
    }

    .metric {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 12px 14px;
      min-height: 78px;
    }

    .metric .label {
      color: var(--muted);
      font-size: 12px;
      margin-bottom: 5px;
    }

    .metric .value {
      font-size: 24px;
      font-weight: 700;
      letter-spacing: 0;
    }

    .metric .hint {
      color: var(--muted);
      margin-top: 3px;
      font-size: 12px;
    }

    .section-title {
      font-size: 16px;
      margin: 18px 0 10px;
      font-weight: 700;
    }

    details.block {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 8px;
      margin-bottom: 10px;
      overflow: hidden;
    }

    details.block[open] {
      border-color: var(--line-strong);
    }

    summary {
      list-style: none;
      cursor: pointer;
    }

    summary::-webkit-details-marker {
      display: none;
    }

    .block-summary {
      display: grid;
      grid-template-columns: minmax(260px, 1fr) repeat(5, minmax(100px, auto));
      gap: 10px;
      align-items: center;
      padding: 13px 14px;
      border-bottom: 1px solid transparent;
    }

    details[open] .block-summary {
      border-bottom-color: var(--line);
    }

    .block-name {
      display: flex;
      align-items: center;
      gap: 9px;
      min-width: 0;
      font-weight: 700;
    }

    .chevron {
      width: 20px;
      height: 20px;
      border: 1px solid var(--line-strong);
      display: inline-grid;
      place-items: center;
      border-radius: 50%;
      flex: 0 0 auto;
      color: var(--focus);
      font-size: 12px;
    }

    details[open] .chevron {
      transform: rotate(90deg);
    }

    .block-path {
      color: var(--muted);
      font-size: 12px;
      margin-top: 3px;
      font-weight: 400;
    }

    .pill {
      display: inline-flex;
      flex-direction: column;
      gap: 1px;
      align-items: flex-start;
      min-width: 96px;
      color: var(--muted);
      font-size: 12px;
    }

    .pill strong {
      color: var(--text);
      font-size: 14px;
      font-weight: 700;
    }

    .table-wrap {
      width: 100%;
      overflow-x: auto;
    }

    table {
      width: 100%;
      border-collapse: collapse;
      table-layout: fixed;
      min-width: 1360px;
    }

    th,
    td {
      border-bottom: 1px solid #edf0f3;
      padding: 8px 10px;
      text-align: left;
      vertical-align: middle;
      word-break: break-word;
    }

    th {
      background: #fafbfc;
      color: #4d5a67;
      font-size: 12px;
      font-weight: 700;
      white-space: nowrap;
    }

    tr:last-child td {
      border-bottom: 0;
    }

    input,
    select {
      width: 100%;
      min-height: 34px;
      border: 1px solid var(--line-strong);
      border-radius: 6px;
      padding: 6px 8px;
      font: inherit;
      background: #fff;
      color: var(--text);
    }

    input[type="checkbox"] {
      width: 18px;
      height: 18px;
      min-height: 18px;
      padding: 0;
      margin: 0;
      accent-color: var(--accent);
    }

    input:focus,
    select:focus,
    button:focus {
      outline: 2px solid rgba(15, 94, 115, 0.2);
      border-color: var(--focus);
    }

    .muted {
      color: var(--muted);
    }

    .good {
      color: var(--green);
      font-weight: 700;
    }

    .warn {
      color: var(--amber);
      font-weight: 700;
    }

    .empty {
      color: var(--muted);
      padding: 18px 14px;
    }

    .other-form {
      display: grid;
      grid-template-columns: 140px minmax(220px, 1.5fr) 120px 220px 100px 160px 120px;
      gap: 8px;
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 12px;
      margin-bottom: 12px;
      align-items: end;
    }

    .block-add-form {
      display: grid;
      grid-template-columns: 140px minmax(180px, 1.5fr) 110px 160px 90px 140px 110px;
      gap: 8px;
      align-items: end;
      padding: 12px 14px;
      border-bottom: 1px solid var(--line);
      background: #fbfcfd;
    }

    .field label {
      display: block;
      color: var(--muted);
      font-size: 12px;
      margin-bottom: 5px;
    }

    .actions {
      display: flex;
      gap: 6px;
      align-items: center;
    }

    .select-cell {
      text-align: center;
    }

    .select-box {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      color: var(--muted);
      font-size: 12px;
      font-weight: 400;
      cursor: pointer;
      white-space: nowrap;
    }

    .gpa-digits {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      font-size: 12px;
      color: var(--muted);
      white-space: nowrap;
    }

    .gpa-digits button {
      padding: 2px 7px;
      line-height: 1.2;
      font-size: 13px;
    }

    .gpa-digits input {
      width: 44px;
      text-align: center;
      border: 1px solid var(--line);
      border-radius: 5px;
      padding: 3px 4px;
      font: inherit;
      font-size: 13px;
      color: var(--text);
      background: #fff;
    }

    .gpa-digits input:focus {
      outline: 2px solid var(--focus);
      outline-offset: -1px;
    }

    .gpa-value {
      font-weight: 700;
      color: var(--focus);
    }

    tr.semester-draggable {
      cursor: grab;
    }

    tr.semester-draggable.dragging {
      opacity: 0.45;
    }

    tr.semester-draggable.drop-before > td {
      border-top: 3px solid var(--focus);
    }

    tr.semester-draggable.drop-after > td {
      border-bottom: 3px solid var(--focus);
    }

    details.block.drag-target {
      border-color: var(--focus);
      box-shadow: 0 0 0 2px rgba(15, 94, 115, 0.12);
    }

    .saved {
      color: var(--muted);
      font-size: 12px;
      min-width: 120px;
      text-align: right;
    }

    @media (max-width: 900px) {
      .shell {
        width: min(100vw - 20px, 1480px);
      }

      .summary-grid {
        grid-template-columns: repeat(2, 1fr);
      }

      .custom-stat {
        grid-template-columns: 1fr;
      }

      .block-summary {
        grid-template-columns: 1fr 1fr;
      }

      .block-name {
        grid-column: 1 / -1;
      }

      .other-form {
        grid-template-columns: 1fr 1fr;
      }

      .block-add-form {
        grid-template-columns: 1fr 1fr;
      }
    }

    @media (max-width: 560px) {
      .summary-grid,
      .selection-result,
      .other-form {
        grid-template-columns: 1fr;
      }

      .block-add-form {
        grid-template-columns: 1fr;
      }

      h1 {
        font-size: 19px;
        white-space: normal;
      }
    }
    [hidden] { display: none !important; }

