* { box-sizing: border-box; }
[hidden] { display: none !important; }
:root {
  color-scheme: light;
  --ink: #172629;
  --muted: #52646a;
  --line: #dce5e4;
  --pop: #156d60;
  --deep: #0f483f;
  --bg: #f0f5f4;
  --surface: #fff;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
body { margin: 0; font-size: 1rem; }
button, input { font: inherit; }
button, .button-link {
  cursor: pointer; padding: .58rem .91rem; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: .48rem; font-size: .9rem; text-decoration: none;
}
button:hover, .button-link:hover { background: #edf5f3; }
button:disabled { opacity: .55; cursor: default; }
button.primary { color: white; background: var(--pop); border-color: var(--pop); }
button.primary:hover:enabled { background: var(--deep); }
button.danger { color: #9b2825; }
:focus-visible { outline: 2px solid #238a78; outline-offset: 3px; }
input:not([type=checkbox]) {
  width: 100%; min-width: 0; padding: .66rem .78rem; border: 1px solid #b9cdc9;
  border-radius: .46rem; color: var(--ink); background: var(--surface);
}
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.6rem, 3vw, 2rem); font-weight: 700; }
h2 { font-size: 1.25rem; }
.login-screen { min-height: 100svh; display: grid; place-items: center; padding: 1rem; }
.login-card {
  width: min(100%, 25rem); display: grid; gap: 1rem; border: 1px solid var(--line);
  border-radius: 1rem; background: white; padding: 2.1rem; box-shadow: 0 1rem 3.5rem #183c3514;
}
.login-card h1 { margin-bottom: .4rem; }
label { display: grid; gap: .42rem; font-size: .9rem; font-weight: 600; }
.form-message { color: #9b2825; font-size: .9rem; }
.form-message:empty { display: none; }
.brand-mark {
  display: inline-grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: .55rem;
  color: white; background: var(--pop); font-size: 1rem; font-weight: 700; flex-shrink: 0;
}
.app { min-height: 100svh; display: grid; grid-template-columns: 13.5rem minmax(0, 1fr); }
.sidebar {
  min-height: 100%; display: flex; flex-direction: column; gap: 2rem; padding: 1.4rem 1rem;
  color: white; background: #142e2b;
}
.brand { display: flex; align-items: center; gap: .7rem; margin-inline: .25rem; }
.sidebar nav { display: grid; gap: .38rem; }
.sidebar button {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  text-align: left; background: transparent; color: #e2efec; border-color: transparent;
}
.sidebar button:hover, .sidebar button[aria-current=page] {
  color: #fff; background: #244a44; border-color: #3f625a;
}
#draft-count { color: #b9ece0; font-variant-numeric: tabular-nums; }
.identity {
  margin-top: auto; display: flex; justify-content: space-between; align-items: center;
  gap: .3rem; border-top: 1px solid #3b5955; padding: .75rem 0 0 .35rem; font-size: .88rem;
}
#account { overflow: hidden; text-overflow: ellipsis; }
.workspace { min-width: 0; width: 100%; max-width: 96rem; padding: 2rem clamp(1rem, 3vw, 2.7rem); }
.page-header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: flex-end; }
.page-header p { color: var(--muted); margin-top: .44rem; font-size: .94rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .48rem; }
.notice, .upload-status { margin-top: 1rem; padding: .8rem 1rem; border-radius: .5rem; background: #d9efe8; }
.notice.error { background: #fae7e4; color: #842521; }
.upload-status { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; }
progress { width: min(100%, 16rem); accent-color: var(--pop); }
.panel {
  margin-top: 1.25rem; background: var(--surface); border: 1px solid var(--line);
  border-radius: .72rem; overflow: hidden;
}
.panel-tools {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: .6rem; padding: .9rem 1rem;
}
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: .32rem; min-width: 3rem; }
.crumb { border: 0; padding: .35rem .45rem; color: var(--pop); }
.crumb[aria-current=page] { color: var(--ink); font-weight: 650; }
.crumb-divider { color: var(--muted); }
.search { width: min(100%, 15rem); }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
thead { color: #37504f; background: #f1f6f5; }
th { font-weight: 650; font-size: .88rem; }
th, td { padding: .75rem .95rem; vertical-align: middle; }
td { border-bottom: 1px solid #e8eeed; font-size: .92rem; }
td:first-child { max-width: 30rem; overflow-wrap: anywhere; }
td.timing, td.size { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
td .actions { flex-wrap: nowrap; }
.entry-name { font-weight: 600; }
.directory { color: var(--pop); font-weight: 650; padding: .25rem 0; border: 0; text-align: left; }
.folder-icon { display: inline-block; width: 1rem; height: .71rem; margin-right: .55rem; position: relative;
  border-radius: .12rem; background: #82b6a9; vertical-align: .01rem; }
.folder-icon::before { content: ""; position: absolute; width: .43rem; height: .22rem; left: 0; top: -.15rem;
  border-radius: .12rem .12rem 0 0; background: #82b6a9; }
.entry-detail { display: block; margin-top: .25rem; color: var(--muted); font-size: .82rem; }
.digest { font-family: ui-monospace, monospace; white-space: nowrap; }
.empty { padding: 3rem 1rem; text-align: center; color: var(--muted); }
.panel footer { padding: .72rem .95rem; font-size: .85rem; color: var(--muted); }
dialog {
  max-width: min(calc(100vw - 2rem), 48rem); width: 32rem; padding: 1.25rem;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: .8rem;
}
dialog::backdrop { background: #0d221faa; }
dialog form { display: grid; gap: .9rem; }
dialog header, .dialog-actions { display: flex; gap: .7rem; justify-content: space-between; align-items: center; }
.dialog-actions { justify-content: flex-end; }
#dialog-message { line-height: 1.6; overflow-wrap: anywhere; color: var(--muted); }
pre { max-height: 52vh; overflow: auto; margin: 0; background: #142e2b; color: #effaf6;
  white-space: pre-wrap; overflow-wrap: anywhere; padding: .85rem; border-radius: .42rem; font-size: .86rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { min-height: auto; gap: .75rem; padding: .75rem 1rem; }
  .sidebar nav { display: flex; flex-wrap: wrap; }
  .identity { padding-top: .45rem; }
  .workspace { padding: 1rem; }
  th, td { padding: .65rem; }
}

.draft-label { display: flex; align-items: center; gap: .55rem; overflow-wrap: anywhere; }
.draft-label input { accent-color: var(--pop); }

