:root {
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: #f5f5fb;
  --ink: #23272f;
  --subtle: #626b79;
  --line: #e4e6ed;
  --control-line: #d4d9e3;
  --accent: #1764b8;
  --accent-soft: #eaf3fe;
  --paper: #fff;
  --sidebar-width: 15.5rem;
  --topbar-height: 4rem;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
#layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100dvh;
}
#layout:has(#sidebar[hidden]), #layout.sidebar-collapsed { display: block; }
.sidebar-collapsed #sidebar { display: none; }
#sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-right: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  font-weight: 700;
  font-size: 1.2rem;
}
#sidebar .brand { min-height: var(--topbar-height); padding: .65rem 1.2rem; }
.mark {
  display: inline-flex;
  justify-content: center;
  height: 2.15rem;
  width: 2.15rem;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
  border-radius: .5rem;
  background: var(--accent-soft);
  padding: .5rem;
}
.mark i { width: 2px; height: 38%; background: var(--accent); border-radius: 2px; }
.mark i:nth-child(2), .mark i:nth-child(4) { height: 75%; }
.mark i:nth-child(3) { height: 100%; }
.icon {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#navigation { min-height: 0; overflow-y: auto; padding: 1rem .75rem; }
.nav-group + .nav-group { margin-top: 1.35rem; }
.nav-group-label { margin: 0 0 .35rem; padding: 0 .65rem; color: var(--subtle); font-size: .86rem; overflow-wrap: anywhere; }
#navigation button {
  display: flex;
  align-items: center;
  gap: .7rem;
  width: 100%;
  padding: .67rem .75rem;
  text-align: left;
  color: var(--ink);
  background: transparent;
  font-weight: 550;
  overflow-wrap: anywhere;
}
#navigation button:hover { background: #f5f7fb; }
#navigation button[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
#sidebar footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  margin-top: auto;
  padding: .9rem 1.05rem;
  border-top: 1px solid var(--line);
}
.identity { display: grid; gap: .15rem; min-width: 0; overflow-wrap: anywhere; }
#identity-account { color: var(--subtle); font-size: .84rem; }
#logout { flex: 0 0 auto; font-size: .86rem; padding: .28rem .55rem; }
.workspace-shell { min-width: 0; }
#workspace-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar {
  display: flex;
  align-items: center;
  gap: .9rem;
  min-height: var(--topbar-height);
  padding: .5rem clamp(.75rem, 2.5vw, 2rem);
  background: var(--paper);
}
.menu-toggle {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.45rem;
  height: 2.45rem;
  padding: 0;
  color: var(--subtle);
  background: transparent;
}
.menu-toggle:hover { background: var(--accent-soft); color: var(--accent); }
#breadcrumb { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.breadcrumb-parent, .breadcrumb-current {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.breadcrumb-current { color: var(--subtle); }
.breadcrumb-divider { flex: 0 0 auto; color: #929baa; }
main { padding: clamp(1rem, 2.5vw, 2rem); max-width: 100rem; margin-inline: auto; }
main:focus { outline: none; }
h1 { font-size: clamp(1.4rem, 2vw, 1.8rem); margin: 0; line-height: 1.3; overflow-wrap: anywhere; }
h2 { font-size: 1.15rem; margin: 0 0 .85rem; }
p { margin: .45rem 0; }
.page-header {
  display: flex;
  gap: .65rem 1rem;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 1.15rem;
  flex-wrap: wrap;
}
.page-header p { margin: .25rem 0 0; }
.actions:empty { display: none; }
.subtle { color: var(--subtle); }
.profile-description { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.profile-description:only-child { max-width: 65ch; }
.card, details {
  min-width: 0;
  margin-bottom: 1rem;
  padding: 1.15rem clamp(.85rem, 2vw, 1.5rem);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: .45rem;
}
details { padding: .7rem .9rem; }
details:last-child { margin-bottom: 0; }
details > summary { cursor: pointer; font-weight: 650; }
details[open] > summary { margin-bottom: .65rem; }
.login { width: min(100%, 27rem); margin: clamp(1rem, 12vh, 7rem) auto 0; padding: clamp(1.2rem, 5vw, 2rem); }
.login .brand { margin-bottom: 1.25rem; }
.login h1 { font-size: 1.55rem; }
.login-intro { margin: .55rem 0 1.15rem; }
form { display: grid; gap: .9rem; }
.configuration-fields { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.configuration-fields button { grid-column: 1 / -1; justify-self: start; }
.settings-group { display: grid; gap: .9rem; min-width: 0; margin: 0; border: 1px solid var(--line); border-radius: .4rem; padding: .85rem 1rem 1rem; }
.settings-group legend { padding: 0 .35rem; font-weight: 650; }
.settings-field .field-hint { margin: .2rem 0 0; font-size: .85rem; color: var(--subtle); }
.settings-group + button { justify-self: start; }
form:has(.settings-group) + .actions:not(:empty), .table-wrap + form { margin-top: .9rem; }
.form-row, .actions { display: flex; align-items: end; gap: .65rem; flex-wrap: wrap; }
.organization-tools { display: flex; flex-wrap: wrap; align-items: start; justify-content: space-between; gap: 1rem 1.5rem; }
.organization-tools form:not(.form-row) { flex: 0 1 27rem; }
.member-editor { margin-top: 1rem; }
.member-editor h2 { margin: 0; }
.form-row + .table-wrap, .pagination { margin-top: .85rem; }
.pagination { align-items: center; color: var(--subtle); }
label { display: grid; gap: .3rem; color: #3d4757; font-weight: 550; font-size: .92rem; min-width: 0; max-width: 100%; }
input, select, textarea, button { font: inherit; }
input, select, textarea {
  min-width: 0;
  max-width: 100%;
  padding: .5rem .65rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--control-line);
  border-radius: .35rem;
}
textarea { min-height: 7rem; resize: vertical; }
button {
  padding: .48rem .85rem;
  color: #fff;
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: .4rem;
  font-weight: 600;
  cursor: pointer;
}
button:disabled { opacity: .48; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button:not([class]):not(:disabled):hover { background: #10549d; }
.quiet { background: var(--paper); border-color: var(--control-line); color: #435064; }
.quiet:not(:disabled):hover { color: var(--accent); border-color: #a7cbf1; background: #f7fbff; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-variant-numeric: tabular-nums; }
th, td { padding: .72rem .75rem; border-bottom: 1px solid var(--line); min-width: 4.75rem; }
th { background: #f8f9fc; color: #505c6e; font-weight: 650; font-size: .9rem; white-space: nowrap; }
tbody tr:hover { background: #fafbfe; }
.link { background: none; color: var(--accent); padding: 0; text-align: left; overflow-wrap: anywhere; }
.link:hover { text-decoration: underline; text-underline-offset: .2em; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); gap: .8rem; margin-bottom: 1rem; }
.metric { margin: 0; }
.metric strong { font-size: 1.75rem; line-height: 1.3; display: block; margin-top: .3rem; font-variant-numeric: tabular-nums; }
#status { color: #663c26; background: #fff3e6; border: 1px solid #f3d7b9; padding: .6rem .9rem; border-radius: .4rem; margin: 0 0 1rem; overflow-wrap: anywhere; }
#workspace:has(.login) #status { max-width: 27rem; margin-inline: auto; }
#workspace:has(.login) #status:not([hidden]) + #view .login { margin-top: 0; }
.transcript { white-space: pre-wrap; overflow-wrap: anywhere; }
audio { display: block; width: min(100%, 32rem); margin: .85rem 0; }
a { color: var(--accent); }
@media (max-width: 760px) {
  #layout { display: block; position: relative; }
  #sidebar {
    position: absolute;
    z-index: 1;
    top: var(--topbar-height);
    left: 0;
    width: min(var(--sidebar-width), 100%);
    height: auto;
    max-height: calc(100dvh - var(--topbar-height));
    border-bottom: 1px solid var(--line);
    border-radius: 0 0 .45rem 0;
    box-shadow: 0 .5rem 1.4rem #23272f1c;
  }
  #sidebar .brand { border-bottom: 1px solid var(--line); }
  .topbar { position: relative; z-index: 2; height: var(--topbar-height); }
  #breadcrumb { gap: .4rem; }
}
