:root {
  color: #16243b;
  background: #f0f4f9;
  font-family: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  font-size: 100%;
  line-height: 1.55;
  --nav: #14243d;
  --muted: #53657c;
  --border: #dce4ee;
  --accent: #2054ce;
  --accent-dark: #173d9d;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 750; line-height: 1.2; }
h2 { font-size: 1.18rem; line-height: 1.4; }
h3 { font-size: 1rem; }
a { color: var(--accent-dark); text-underline-offset: 0.22em; }
a:hover { color: var(--accent); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #4582f4; outline-offset: 3px; }
img { max-width: 100%; display: block; }
.skip { position: fixed; left: 1rem; top: -6rem; z-index: 9; background: white; padding: 0.5rem; }
.skip:focus { top: 1rem; }
.shell { display: grid; grid-template-columns: 15rem minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  overflow: auto;
  padding: 2rem 1.1rem 1.2rem;
  background: var(--nav);
  color: #eef4ff;
}

.brand, .user-info {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
  text-decoration: none;
}
.brand:hover, .user-info:hover { color: white; }
.brand strong, .user-info strong { display: block; overflow-wrap: anywhere; }
.brand small, .user-info small { display: block; color: #c1cee3; font-size: 0.76rem; }
.brand-icon, .avatar { display: grid; place-items: center; flex: 0 0 auto; border-radius: 0.65rem; }
.brand-icon { width: 2.6rem; height: 2.6rem; color: #152d58; background: #d8e5ff; font-size: 1.55rem; }
.avatar { width: 2.15rem; height: 2.15rem; background: #304869; }
.nav { display: grid; gap: 0.3rem; }
.nav a { color: #d6e3f8; text-decoration: none; padding: 0.68rem 0.8rem; border-radius: 0.5rem; font-size: 0.94rem; }
.nav a:hover, .nav a[aria-current=page] { color: #fff; background: #2c4266; }
.nav a[aria-current=page] { box-shadow: inset 3px 0 #a9c4ff; font-weight: 700; }
.nav-separator { height: 1px; background: #354764; margin: 0.5rem 0; }
.user-panel { border-top: 1px solid #354764; padding-top: 0.9rem; margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 0.35rem; }
.sidebar-logout { color: #e0eafe; background: transparent; border: 0; border-radius: 0.3rem; padding: 0.55rem; font-size: 0.87rem; white-space: nowrap; }
.sidebar-logout:hover { background: #2c4266; }

.content { width: min(100%, 91rem); margin-inline: auto; padding: clamp(1rem, 3vw, 3rem); }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.6rem; }
.page-header p { margin-top: 0.55rem; }
.dashboard-header {
  padding: clamp(1.2rem, 3vw, 2.25rem);
  border: 1px solid #d4dfed;
  background: linear-gradient(115deg, #f9fbff 10%, #e0ebfb 100%);
  border-radius: 1.1rem;
}
.dashboard-header .eyebrow { font-size: 0.86rem; color: #2d518d; margin: 0 0 0.6rem; }
.dashboard-header p, .meta, .subtle { color: var(--muted); }
.meta, .breadcrumb { font-size: 0.875rem; }
.breadcrumb { display: inline-block; margin-bottom: 0.5rem; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.activity { grid-row: span 2; }
.results-panel { grid-column: 1 / -1; }
.panel {
  min-width: 0;
  padding: clamp(1rem, 2.2vw, 1.5rem);
  margin-bottom: 1rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  box-shadow: 0 2px 4px #15284608;
}
.dashboard-grid .panel { margin: 0; }
.narrow { max-width: 55rem; }
.section-header, .split { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.55rem 0.85rem; }
.section-header > a { font-size: 0.875rem; }
.section-header .meta { margin-top: 0.24rem; }
.clean-list { margin: 0.45rem 0 0; padding: 0; list-style: none; }
.list-item { padding: 0.75rem 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.list-item:last-child { border-bottom: 0; }
.list-item .meta { margin-top: 0.25rem; }
.item-title { display: flex; flex-wrap: wrap; gap: 0.4rem 0.55rem; align-items: baseline; }
.item-title a { font-weight: 650; color: #233f70; }
.item-title a:hover { color: var(--accent); }
.group-heading { margin: 1rem 0 0; padding: 0.38rem 0.6rem; border-radius: 0.3rem; background: #eef3f9; color: #365477; font-variant-numeric: tabular-nums; font-size: 0.875rem; }
.empty { color: var(--muted); margin-top: 0.8rem; padding: 1rem; background: #f3f6fb; border-radius: 0.5rem; font-size: 0.94rem; }
.empty p { margin-bottom: 0.3rem; }
.badge { display: inline-block; width: fit-content; white-space: nowrap; font-size: 0.875rem; font-weight: 650; padding: 0.12rem 0.55rem; border-radius: 2rem; vertical-align: middle; }
.badge.todo { color: #405571; background: #edf2f7; }
.badge.doing { color: #1747a4; background: #e8efff; }
.badge.blocked { color: #8c3d15; background: #fff0da; }
.badge.done { color: #18634f; background: #e1f6ed; }

.button {
  display: inline-flex;
  min-height: 2.75rem;
  justify-content: center;
  align-items: center;
  gap: 0.22rem;
  padding: 0.55rem 1rem;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  font-size: 0.94rem;
  font-weight: 650;
  text-decoration: none;
}
.primary { color: white; background: var(--accent); }
.primary:hover { color: white; background: var(--accent-dark); }
.secondary { color: #263e61; background: white; border-color: #becce0; }
.secondary:hover { background: #edf3fb; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.65rem; }
.align-end, .status-form { align-items: flex-end; }
.status-form, .pagination { margin-top: 1rem; }
.status-label { width: min(100%, 12rem); }
.form-stack { display: grid; gap: 1.1rem; }
.form-grid, .filter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; }
.three, .filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.filter-panel { display: grid; gap: 0.9rem; }
.filter-keyword { grid-column: 1 / -1; }
label { display: block; color: #233b5a; font-weight: 600; font-size: 0.94rem; min-width: 0; }
.grow { flex: 1 1 14rem; }
input:not([type=checkbox]):not([type=hidden]), select, textarea {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 2.75rem;
  margin-top: 0.28rem;
  padding: 0.55rem 0.65rem;
  color: #15243b;
  border: 1px solid #bdcce0;
  border-radius: 0.42rem;
  background-color: white;
  font-size: 1rem;
  font-weight: 400;
}
select {
  appearance: none;
  padding-right: 2rem;
  background-image: linear-gradient(45deg, transparent 50%, #425b7d 50%), linear-gradient(135deg, #425b7d 50%, transparent 50%);
  background-position: calc(100% - 16px) center, calc(100% - 11px) center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
textarea { resize: vertical; }
.check { display: flex; gap: 0.55rem; align-items: flex-start; cursor: pointer; }
.check input { width: 1.25rem; height: 1.25rem; flex: 0 0 auto; margin: 0.14rem 0 0; accent-color: var(--accent); }
.required { color: var(--muted); font-size: 0.83rem; margin-left: 0.5rem; }
.file-fields { min-inline-size: 0; display: grid; gap: 0.75rem; border: 1px solid var(--border); border-radius: 0.5rem; padding: 0.8rem; }
.file-fields legend { padding: 0 0.4rem; font-weight: 650; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 0.3rem; }
.material-list { display: flex; flex-wrap: wrap; gap: 0.55rem; list-style: none; padding: 0; margin: 0.55rem 0 0; }
.material-list li { min-width: 0; max-width: 100%; }
.material-list a { display: grid; gap: 0.35rem; padding: 0.42rem; background: #f3f6fb; border-radius: 0.45rem; overflow-wrap: anywhere; }
.material-list img { max-height: 21rem; border-radius: 0.3rem; object-fit: contain; }
.material-list.compact { font-size: 0.875rem; }
.material-list.compact img { width: 5.5rem; height: 4rem; }
.member-controls { margin-top: 0.55rem; }
.member-controls summary { cursor: pointer; color: var(--accent-dark); }
.member-controls > div { padding-top: 0.75rem; }
.record-options { border: 1px solid var(--border); border-radius: 0.5rem; }
.record-options summary { padding: 0.68rem 0.8rem; cursor: pointer; color: var(--accent-dark); }
.record-options > div { padding: 0 0.8rem 0.8rem; }
.block { display: block; }
.inline-link { font-size: 0.875rem; margin-left: 1.8rem; }
.markdown-preview { white-space: pre-wrap; overflow-wrap: anywhere; background: #edf3fa; padding: 1rem; border-radius: 0.5rem; font-size: 0.9rem; }
.notice { padding: 0.7rem 0.9rem; margin: 0 0 1rem; border: 1px solid #b3dbc8; border-radius: 0.5rem; background: #e6f6ec; color: #205440; }
.notice-error { border-color: #edc6be; background: #fff0ed; color: #812921; }
.guest-content { width: min(100% - 2rem, 30rem); margin: clamp(1rem, 10vh, 7rem) auto; }
.login-card { background: white; border: 1px solid var(--border); border-radius: 0.9rem; padding: clamp(1.25rem, 6vw, 2.5rem); box-shadow: 0 12px 45px #243d6017; }
.login-card h1 { margin-top: 1rem; }
.login-card > .subtle { margin-top: 0.55rem; }
.login-card form, .login-card > .button { margin-top: 1.5rem; }
.login-brand { display: flex; align-items: center; gap: 0.7rem; font-size: 0.94rem; color: #2c4a77; }
.login-card form button { width: 100%; }

@media (max-width: 63rem) {
  .shell { grid-template-columns: 12.5rem minmax(0, 1fr); }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .activity { grid-row: auto; }
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 47rem) {
  .shell { display: block; }
  .sidebar { position: static; height: auto; padding: 0.65rem 0.85rem 0.5rem; gap: 0.5rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .brand-icon { width: 2rem; height: 2rem; font-size: 1.25rem; }
  .brand small { display: none; }
  .user-panel { grid-column: 2; grid-row: 1; padding: 0; border: 0; margin: 0; }
  .user-info strong, .user-info small { display: none; }
  .nav { display: flex; grid-column: 1 / -1; overflow: auto; padding: 0.3rem 0.2rem; }
  .nav a { white-space: nowrap; padding: 0.55rem 0.65rem; }
  .nav a[aria-current=page] { box-shadow: inset 0 -2px #a9c4ff; }
  .nav-separator { display: none; }
  .three { grid-template-columns: 1fr; }
}

@media (max-width: 28rem) {
  .page-header .button { width: 100%; }
  .form-grid, .filter-grid { grid-template-columns: minmax(0, 1fr); }
  .item-title { align-items: flex-start; }
}
