:root {
  --page: #f7f7f7;
  --surface: #fff;
  --ink: #333;
  --muted: #666;
  --quiet: #999;
  --line: #eee;
  --green: #74bf28;
  --radius: 8px;
}

* { box-sizing: border-box; }
html { background: var(--page); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--page);
  font-family: "Source Han Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
}
button { border: 0; color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 2px solid #3686ff; outline-offset: 2px; }
.mobile-statusbar, .mobile-more-button { display: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  height: 54px;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: #fff;
  box-shadow: 0 4px 5px rgba(78, 89, 105, .05);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 500; }
.brand picture, .brand img { display: block; width: 20px; height: 20px; }
.topbar-actions { display: flex; align-items: center; gap: 16px; }
.avatar-button, .icon-button { display: grid; place-items: center; padding: 0; background: none; cursor: pointer; }
.avatar-button img { width: 30px; height: 30px; border-radius: 50%; }
.icon-button img { width: 16px; height: 16px; }
.divider { width: 1px; height: 10px; margin: 0 8px; background: #ddd; }

.page-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 444px;
  gap: 20px;
  width: 100%;
  padding: 24px clamp(24px, calc(13.54vw - 162px), 90px) 38px;
}
.main-column, .side-column { display: flex; min-width: 0; flex-direction: column; gap: 16px; }
.card-surface { border-radius: var(--radius); background: rgba(255, 255, 255, .9); }

.notice { display: flex; min-height: 54px; align-items: center; justify-content: space-between; padding: 16px; color: var(--muted); }
.notice-copy { display: flex; min-width: 0; align-items: center; gap: 8px; }
.notice-copy picture { display: block; flex: 0 0 14px; width: 14px; height: 22px; }
.notice-copy img { width: 14px; height: 22px; }
.notice-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-button { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; padding: 0; background: none; color: var(--muted); cursor: pointer; }
.notice-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.notice-separator { width: 1px; height: 10px; background: #ddd; }
.notice-close { width: 16px; height: 18px; padding: 0; background: none; color: var(--muted); font-size: 18px; line-height: 16px; cursor: pointer; }

.banner { position: relative; display: block; width: 100%; height: 194px; padding: 0; overflow: hidden; border-radius: var(--radius); background: #f5fff5; text-align: left; }
.banner > img { position: absolute; top: 0; right: 0; display: block; width: auto; max-width: none; height: 194px; }
.banner-copy { position: relative; z-index: 1; display: flex; width: min(478px, calc(100% - 48px)); height: 100%; flex-direction: column; justify-content: center; gap: 16px; margin-left: 24px; }
.banner-copy strong { font-size: 20px; font-weight: 900; line-height: 30px; }
.banner-copy > span { color: var(--muted); font-size: 14px; line-height: 28px; }

.systems-stack { display: flex; flex-direction: column; gap: 16px; }
.systems-panel { overflow: hidden; border-radius: 16px; }
.systems-toolbar { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 20px; padding: 8px 16px; }
.systems-toolbar h2 { margin: 0; font-size: 14px; line-height: 20px; }
.mobile-environment { display: none; }
.category-tabs { display: flex; min-width: 0; align-items: flex-start; gap: 32px; }
.category-tab { position: relative; padding: 0 0 12px; background: none; color: var(--muted); line-height: 20px; white-space: nowrap; cursor: pointer; }
.category-tab.active { color: var(--ink); font-weight: 700; }
.category-tab.active::after { position: absolute; right: 0; bottom: 0; left: 0; height: 2px; border-radius: 2px; background: var(--ink); content: ""; }
.segmented { display: flex; flex: 0 0 auto; gap: 2px; padding: 2px; border: 1px solid #e2e2e2; border-radius: 8px; background: #fff; }
.segmented button { min-width: 68px; height: 28px; padding: 0 12px; border-radius: 6px; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; }
.segmented button.active { border-radius: 6px; background: #333; color: #fff; font-weight: 700; }

.system-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0 16px 16px; }
.system-card { position: relative; display: grid; min-height: 120px; grid-template-rows: minmax(48px, 1fr) 24px; row-gap: 16px; align-items: start; overflow: hidden; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.system-card::before { position: absolute; top: -1px; left: -1px; width: calc(100% + 2px); height: 60px; background: linear-gradient(to top, #fff, var(--tint)); content: ""; opacity: .3; }
.system-info { position: relative; display: flex; min-width: 0; gap: 12px; }
.system-icon-wrap { display: grid; flex: 0 0 48px; width: 48px; height: 48px; place-items: center; border-radius: 12px; background: var(--icon-bg); }
.system-icon { width: 28px; height: 28px; }
.system-copy { min-width: 0; padding-top: 1px; }
.system-title { display: flex; align-items: center; gap: 8px; }
.system-title strong { font-size: 14px; line-height: 19px; }
.version { padding: 3px 8px; border-radius: 4px; background: #f7f7f7; color: var(--muted); font-size: 10px; line-height: 13px; }
.system-copy p { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 18px; }
.card-actions { position: relative; display: flex; height: 24px; align-items: stretch; gap: 12px; margin-top: 0; }
.small-button { display: inline-flex; height: 24px; align-items: center; justify-content: center; padding: 0 8px; border: 1px solid #ccc; border-radius: 4px; background: #fff; color: #222; font-size: 12px; line-height: 1; cursor: pointer; }
.small-button.primary { border-color: #222; background: #222; color: #fff; }

.overview { padding: 16px; }
.overview h2, .section-heading h2 { margin: 0; font-size: 14px; line-height: 20px; }
.overview img { display: block; width: min(100%, 880px); height: auto; margin: 10px auto 0; }

.profile-panel, .todo-panel, .documents-panel { padding: 16px; }
.profile { display: flex; align-items: center; gap: 16px; }
.profile-avatar { width: 52px; height: 52px; border-radius: 50%; }
.profile-name { display: flex; align-items: center; gap: 8px; }
.profile-name strong { font-size: 16px; line-height: 20px; }
.profile-name span { padding: 3px 6px; border-radius: 4px; background: #f4f4f4; color: var(--muted); font-size: 10px; }
.profile-copy p { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; color: var(--muted); font-size: 12px; }
.profile-copy p span { width: 1px; height: 8px; background: #ddd; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.edit-trigger { display: flex; align-items: center; gap: 4px; padding: 0; background: none; color: var(--muted); cursor: pointer; }
.edit-trigger img { width: 14px; height: 14px; }
.edit-trigger.done { color: var(--green); }
.shortcut-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.shortcut { position: relative; display: flex; height: 42px; min-width: 0; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.shortcut > img { width: 18px; height: 18px; }
.shortcut span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shortcut-delete { position: absolute; top: -7px; right: -7px; display: none; width: 14px; height: 14px; align-items: center; justify-content: center; padding: 0; background: transparent; cursor: pointer; }
.shortcut-delete img { display: block; width: 14px; height: 14px; }
.shortcut-grid.editing { gap: 12px; padding: 0; }
.shortcut-grid.editing .shortcut-delete { display: flex; }
.shortcut-grid.editing .shortcut { overflow: visible; }
.shortcut.add { justify-content: center; border-color: transparent; background: #f7f7f7; }

.todo-panel, .documents-panel { min-height: 0; }
.todo-heading { margin-top: 0; }
.todo-list { display: flex; min-height: 264px; flex-direction: column; gap: 12px; margin-top: 16px; }
.todo-item { display: flex; min-height: 57px; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.todo-item p { margin: 0 0 7px; line-height: 21px; }
.todo-meta { display: flex; align-items: center; gap: 10px; color: var(--quiet); font-size: 12px; }
.todo-meta i { width: 1px; height: 10px; background: #ddd; }
.todo-link { flex: 0 0 auto; padding: 0; background: none; color: var(--green); cursor: pointer; }
.pagination { display: flex; height: 14px; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 12px; line-height: 14px; }
.pagination button { display: grid; flex: 0 0 14px; width: 14px; height: 14px; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.pagination button img { display: block; width: 14px; height: 14px; }
.pagination button:disabled { cursor: default; opacity: .35; }
.pagination span { display: inline-flex; height: 14px; align-items: center; font-size: 12px; line-height: 14px; }
.pagination b { font-weight: 400; }

.documents-panel .section-heading { margin-top: 0; }
.document-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.document-item { position: relative; display: flex; height: 37px; align-items: center; gap: 4px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.document-item img { width: 14px; height: 14px; }
.document-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.toast { position: fixed; right: 28px; bottom: 28px; z-index: 50; max-width: 360px; padding: 11px 16px; border-radius: 8px; background: rgba(34,34,34,.94); color: #fff; opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.modal-backdrop { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(0,0,0,.28); }
.modal-backdrop[hidden] { display: none; }
.modal { width: 420px; padding: 20px; border-radius: 12px; background: #fff; box-shadow: 0 20px 60px rgba(0,0,0,.18); }
.modal-header { display: flex; align-items: center; justify-content: space-between; }
.modal-header h2 { margin: 0; font-size: 16px; }
.modal-header button { padding: 0 4px; background: none; color: var(--muted); font-size: 24px; cursor: pointer; }
.available-shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.available-shortcuts button { min-height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; text-align: left; cursor: pointer; }
.available-shortcuts button:hover, .shortcut:hover, .document-item:hover, .todo-item:hover, .system-card:hover { border-color: #d4d4d4; box-shadow: 0 3px 10px rgba(0,0,0,.035); }

@media (max-width: 1360px) {
  .category-tabs { gap: 18px; }
  .category-tab { font-size: 13px; }
}

@media (min-width: 1680px) {
  .system-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 2200px) {
  .system-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

@media (max-width: 767px) {
  html { min-width: 0; }
  body { display: flex; min-width: 320px; flex-direction: column; background-color: #eafef8; background-image: url("./assets/mobile-background.png"), linear-gradient(to bottom, #eafef8 0 360px, var(--page) 360px); background-position: top right, top left; background-size: auto 360px, 100% 100%; background-repeat: no-repeat; font-size: 14px; }
  .mobile-statusbar { display: flex; height: 44px; align-items: center; justify-content: space-between; padding: 0 14px 0 21px; }
  .mobile-time { width: 33px; height: 15px; }
  .mobile-signals { display: flex; align-items: center; gap: 4px; }
  .mobile-signals img:nth-child(1) { width: 20px; height: 14px; }
  .mobile-signals img:nth-child(2) { width: 16px; height: 14px; }
  .mobile-signals img:nth-child(3) { width: 25px; height: 14px; }
  .topbar { position: static; height: 54px; padding: 0 16px; background: transparent; box-shadow: none; }
  .topbar-actions { gap: 0; }
  .topbar-actions .divider, .topbar-actions .icon-button { display: none; }
  .page-shell { display: contents; }
  .main-column, .side-column { display: contents; }
  .notice { order: 1; width: calc(100% - 24px); min-height: 38px; margin: 12px 12px 0; padding: 12px; border-radius: 12px; background: rgba(255,255,255,.8); }
  .notice-copy { width: calc(100% - 22px); }
  .notice-copy picture { width: 14px; height: 14px; }
  .notice-copy img { width: 14px; height: 14px; }
  .notice-copy span { flex: 1; }
  .notice-actions .link-button, .notice-actions .notice-separator { display: none; }
  .notice-close { width: 14px; height: 14px; font-size: 16px; }
  .banner { display: none; }
  .profile-panel { order: 2; width: calc(100% - 24px); margin: 20px 12px 0; padding: 12px; border-radius: 12px; }
  .profile { display: none; }
  .section-heading { margin-top: 0; }
  .shortcut-grid { gap: 16px; margin-top: 16px; }
  .shortcut { height: 42px; gap: 4px; padding: 0 8px; }
  .shortcut > img { width: 14px; height: 14px; }
  .shortcut span { font-size: 14px; }
  .shortcut-grid.editing { gap: 16px; }
  .todo-panel { order: 3; width: calc(100% - 24px); margin: 20px 12px 0; padding: 0; overflow: hidden; border-radius: 12px; }
  .todo-heading { height: 48px; margin: 0; background: linear-gradient(#f7ffef, #fff); }
  .todo-heading > h2 { display: none; }
  .todo-heading .segmented { width: 100%; height: 48px; padding: 0; border: 0; border-radius: 0; background: transparent; }
  .todo-heading .segmented button { position: relative; flex: 1; height: 48px; border-radius: 0; background: transparent; color: var(--muted); font-size: 0; }
  .todo-heading .segmented button::before { font-size: 14px; }
  .todo-heading .segmented button:first-child::before { content: "待处理待办"; }
  .todo-heading .segmented button:last-child::before { content: "已处理待办"; }
  .todo-heading .segmented button.active { color: #222; font-weight: 700; }
  .todo-heading .segmented button.active::after { position: absolute; bottom: 4px; left: 50%; width: 24px; height: 2px; border-radius: 4px; background: #333; content: ""; transform: translateX(-50%); }
  .todo-list { min-height: 0; gap: 12px; margin: 0; padding: 12px; }
  .todo-item:nth-child(n+3) { display: none; }
  .todo-item { min-height: 57px; }
  .pagination { display: none; }
  .mobile-more-button { display: flex; width: calc(100% - 24px); height: 32px; align-items: center; justify-content: center; gap: 4px; margin: 0 12px 12px; padding: 0; border-radius: 8px; background: #f7f7f7; color: var(--muted); font-size: 12px; cursor: pointer; }
  .mobile-more-button img { width: 12px; height: 12px; }
  .systems-stack { order: 4; display: flex; width: calc(100% - 24px); flex-direction: column; gap: 20px; margin: 20px 12px 0; }
  .systems-panel { width: 100%; margin: 0; border-radius: 12px; }
  .systems-toolbar { display: flex; min-height: 44px; align-items: center; padding: 12px; background: #fff; }
  .systems-toolbar h2 { font-size: 14px; }
  .desktop-environment { display: none; }
  .mobile-environment { display: flex; align-items: center; gap: 4px; padding: 0; background: none; color: var(--muted); font-size: 12px; cursor: pointer; }
  .mobile-environment img { width: 14px; height: 14px; }
  .system-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; padding: 12px; }
  .system-card { display: flex; width: 100%; min-height: 96px; align-items: center; justify-content: center; padding: 0 2px; border: 0; overflow: visible; background: transparent; text-align: center; }
  .system-card::before, .system-title .version, .system-copy p, .card-actions { display: none; }
  .system-info { width: 100%; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
  .system-copy { padding: 0; }
  .system-title { width: 100%; justify-content: center; }
  .system-title strong { display: block; width: 100%; font-size: 12px; font-weight: 400; line-height: 18px; text-align: center; white-space: normal; overflow-wrap: anywhere; }
  .overview { order: 6; width: calc(100% - 24px); margin: 20px 12px 20px; padding: 12px; border-radius: 16px; }
  .overview img { margin-top: 16px; }
  .documents-panel { order: 5; width: calc(100% - 24px); margin: 20px 12px 0; padding: 12px; border-radius: 12px; }
  .document-list { margin-top: 16px; }
  .document-item:nth-child(n+3) { display: none; }
  .documents-panel .mobile-more-button { width: 100%; margin: 12px 0 0; }
  .modal { width: calc(100% - 24px); }
}
