:root {
  color-scheme: light;
  --text: #172322;
  --muted: #596961;
  --line: #dce6de;
  --paper: #ffffff;
  --canvas: #eff3ec;
  --forest: #21493d;
  --evergreen: #19372f;
  --mint: #cfe6c7;
  --error: #8c352d;
  --radius: 20px;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
  font-size: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--text); background: var(--canvas); line-height: 1.55; }
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .62; }
a { color: inherit; }
:focus-visible { outline: 3px solid #548e75; outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.layout { max-width: 1120px; width: calc(100% - 64px); margin: 0 auto; }

.topbar { background: #17201f; color: #fff; }
.nav { display: flex; justify-content: space-between; align-items: center; min-height: 68px; gap: 16px; }
.wordmark { display: inline-flex; align-items: center; gap: 11px; font-weight: 760; font-size: 1.12rem; letter-spacing: .04em; text-decoration: none; white-space: nowrap; }
.brand-mark { width: 35px; height: 35px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; gap: 3px; color: #bce4a8; background: #31413a; }
.brand-mark i { width: 3px; border-radius: 4px; background: currentColor; height: 10px; }
.brand-mark i:nth-child(2) { height: 18px; }
.brand-mark i:nth-child(3) { height: 13px; }
.nav-actions { display: flex; align-items: center; gap: 6px; }
.nav-button { min-height: 42px; color: #e3ede4; background: transparent; border: 0; border-radius: 9px; padding: 4px 11px; white-space: nowrap; font-size: .88rem; }
.nav-button:hover { background: #31413a; }

.hero { position: relative; overflow: hidden; isolation: isolate; display: flex; align-items: center; min-height: 235px; margin: 28px 0 20px; padding: 30px 34px; border-radius: 23px; background: linear-gradient(112deg, #204539, #244d41 64%, #315b4b); color: #fff; }
.hero > div:first-child { position: relative; z-index: 1; }
.hero-tag { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: .81rem; color: #d6ead2; }
.hero-tag span { width: 8px; height: 8px; border-radius: 50%; background: #b8e0a4; box-shadow: 0 0 0 4px #b8e0a429; }
.hero h1 { font-size: clamp(2.05rem, 4.4vw, 3.32rem); line-height: 1.18; letter-spacing: -.05em; font-weight: 800; }
.hero-note { margin-top: 12px; color: #e4eee0; font-size: .92rem; }
.mobile-break { display: none; }
.hero-decoration { position: absolute; inset: 0 0 0 auto; width: min(36%, 360px); overflow: hidden; }
.hero-decoration::before, .hero-decoration::after { content: ""; position: absolute; width: 270px; aspect-ratio: 1; border: 1px solid #d8e7d03d; border-radius: 50%; top: 50%; left: 53%; translate: -50% -50%; }
.hero-decoration::after { width: 335px; }
.speaker-art { position: absolute; top: 50%; left: 53%; translate: -50% -50%; width: 105px; height: 136px; border-radius: 30px; transform: rotate(-11deg); background: linear-gradient(140deg, #dcebd2, #a1c294); box-shadow: 8px 13px 0 #162d2544, inset 0 0 0 1px #fff6; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 11px; }
.speaker-art span { width: 55px; height: 55px; border-radius: 50%; background: radial-gradient(circle, #426850 0 19%, #446953 20% 33%, #688a70 34% 37%, #426850 38% 54%, #739477 55% 60%, #426850 61%); box-shadow: 0 0 0 2px #ecf7e26e; }
.speaker-art span:first-child { width: 24px; height: 24px; }

.session-loading { margin-top: 42px; color: var(--muted); text-align: center; }
.login-view { overflow: hidden; border: 1px solid var(--line); border-radius: 24px; max-width: 720px; margin: clamp(26px, 9vh, 104px) auto; background: var(--paper); display: grid; grid-template-columns: minmax(160px, 36%) minmax(0, 1fr); box-shadow: 0 18px 55px #21322613; }
.login-decoration { position: relative; min-height: 300px; background: radial-gradient(circle at 53% 50%, #426c53, #21493d 70%); }
.login-content { padding: clamp(23px, 5vw, 42px); }
.login-content h1 { font-size: 1.75rem; font-weight: 760; line-height: 1.25; letter-spacing: -.025em; }
.login-content > p { margin-top: 8px; margin-bottom: 24px; color: var(--muted); font-size: .91rem; }
.login-content .button { margin-top: 12px; }

.dashboard { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; gap: 16px; padding-bottom: 40px; }
.dashboard-right { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--paper); box-shadow: 0 2px 4px #24372d08; }
.card-header, .dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-header h2, .dialog-header h2 { font-size: 1.24rem; font-weight: 750; letter-spacing: -.025em; }
.card-header h2 { display: flex; align-items: center; gap: 8px; }
.count { display: grid; place-items: center; min-width: 24px; padding: 0 5px; height: 24px; border-radius: 999px; color: #355f49; background: #ecf4ec; font-size: .75rem; font-variant-numeric: tabular-nums; }

form label, legend { font-weight: 640; font-size: .88rem; }
form > label, fieldset > label { display: block; margin-bottom: 6px; }
input:not([type=radio]):not([type=checkbox]), select { width: 100%; min-width: 0; min-height: 44px; appearance: none; padding: 9px 11px; border: 1px solid #cad7cc; border-radius: 11px; color: var(--text); background: #fafcf9; }
select { appearance: auto; }
input::placeholder { color: #65766c; opacity: 1; }
input[readonly] { text-overflow: ellipsis; }
input[type=datetime-local] { max-width: 100%; min-inline-size: 0; }
fieldset { padding: 0; margin: 0; border: 0; min-width: 0; }
legend { padding: 0; margin: 0 0 6px; }
.control-row { display: flex; align-items: center; gap: 8px; }
.control-row > :first-child:is(input, select), .control-row > input { flex: 1 1 auto; width: 0; }
.control-row > button { flex: 0 0 auto; }
.field-note { color: var(--muted); font-size: .81rem; line-height: 1.52; }
#device-note { margin-top: 6px; min-height: 1em; }
.mode-options { display: flex; gap: 6px; padding: 4px; margin: 0 0 14px; border: 1px solid var(--line); border-radius: 12px; background: #f0f5ef; }
.mode-button { flex: 1; min-height: 42px; border: 0; border-radius: 9px; color: #36584b; background: transparent; font-size: .9rem; font-weight: 700; }
.mode-button[aria-pressed=true] { color: #fff; background: var(--forest); }
.mode-button[aria-pressed=false]:hover { background: #e3eee2; }
.source-fieldset { margin-top: 15px; margin-bottom: 8px; }
.source-options { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid #dce6de; border-radius: 12px; padding: 3px; gap: 3px; background: #f1f5ef; }
.source-options label { min-width: 0; display: block; position: relative; text-align: center; cursor: pointer; font-weight: 620; }
.source-options input { position: absolute; inline-size: 1px; block-size: 1px; clip-path: inset(50%); }
.source-options span { display: block; padding: 8px 2px; min-height: 37px; color: #506359; border-radius: 8px; white-space: nowrap; font-size: .83rem; }
.source-options input:checked + span { color: #1d4a37; background: #fff; box-shadow: 0 1px 4px #2e4d3520; }
.source-options input:focus-visible + span { outline: 2px solid #548e75; outline-offset: -2px; }
#source-note { margin-top: 6px; margin-bottom: 13px; }
.optional { color: var(--muted); font-size: .76rem; font-weight: 400; margin-left: 4px; }

.button, .text-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 11px; padding: 8px 13px; min-height: 44px; font-weight: 650; line-height: 1.2; white-space: nowrap; font-size: .875rem; }
.primary { color: #fff; background: var(--forest); border-color: var(--forest); }
.primary:hover:not(:disabled) { background: #153b30; }
.secondary { background: var(--mint); color: #21452e; }
.secondary:hover:not(:disabled) { background: #bfe0b4; }
.subtle { background: #f6f9f3; color: #325747; border-color: #dce6de; }
.subtle:hover:not(:disabled) { background: #eaf3e9; }
.text-button { background: transparent; color: var(--forest); border: 0; min-height: 40px; padding: 5px 8px; }
.text-button:hover:not(:disabled) { background: #eaf3e9; }
.full { width: 100%; }
.player-actions { display: flex; gap: 8px; margin-top: 12px; }
.player-actions button { flex: 1; }
.play-glyph { width: 0; height: 0; border-left: 9px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.stop-glyph { width: 9px; height: 9px; border-radius: 2px; background: currentColor; }
.schedule-form { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px; }
.schedule-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 10px; margin-bottom: 8px; }
.schedule-heading h3 { font-size: 1rem; }
.timezone { font-size: .75rem; color: #4c6355; }
.schedule-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 6px; }
.check-label { display: flex; align-items: center; gap: 6px; font-weight: 500; min-height: 44px; cursor: pointer; }
input[type=checkbox] { accent-color: var(--forest); width: 17px; height: 17px; margin: 0; }

.notice { border-radius: 9px; padding: 8px 10px; margin: 9px 0 0; background: #edf3f0; color: #36594b; font-size: .83rem; overflow-wrap: anywhere; }
.notice[data-tone=error] { background: #fcf0ec; color: var(--error); }
.notice[data-tone=success] { background: #e9f4e8; color: #2b603a; }
#app-note, #baidu-result { margin-bottom: 14px; }
.empty-message { color: var(--muted); background: #f5f8f3; padding: 18px 13px; border-radius: 12px; text-align: center; font-size: .87rem; }
.records { margin: 0; padding: 0; list-style: none; max-height: 400px; overflow-y: auto; scrollbar-color: #b2c6b5 transparent; }
.record { display: flex; justify-content: space-between; gap: 9px; padding: 12px 1px; border-top: 1px solid var(--line); }
.record:first-child, .event:first-child { border-top: 0; padding-top: 2px; }
.record:last-child, .event:last-child { padding-bottom: 0; }
.record-main { min-width: 0; }
.record-title { display: block; font-size: .94rem; font-weight: 700; overflow-wrap: anywhere; }
.record-detail { display: block; font-size: .78rem; color: var(--muted); overflow-wrap: anywhere; margin: 2px 0 0; font-variant-numeric: tabular-nums; }
.record-actions { align-self: flex-start; flex-shrink: 0; display: flex; align-items: flex-end; flex-direction: column; gap: 3px; }
.badge { display: inline-flex; align-items: center; background: #eef1ee; color: #4e6258; padding: 3px 7px; border-radius: 999px; font-size: .74rem; white-space: nowrap; font-weight: 600; vertical-align: middle; }
.badge[data-tone=active] { background: #f5f1dd; color: #6d5625; }
.badge[data-tone=success] { background: #e6f3e5; color: #2d5f3b; }
.badge[data-tone=error] { background: #f9e9e4; color: var(--error); }
.cancel-button { min-height: 36px; padding-block: 2px; color: var(--error); }
.cancel-button:hover:not(:disabled) { background: #faebe6; }
.events-note { margin: -6px 0 10px; }
.event { display: flex; gap: 9px; border-top: 1px solid var(--line); padding: 10px 1px; }
.event-dot { flex: 0 0 8px; width: 8px; height: 8px; margin-top: 9px; border-radius: 50%; background: #649979; }
.event-dot[data-tone=error] { background: #b96151; }
.event-message { font-size: .88rem; overflow-wrap: anywhere; }

 dialog { width: min(92%, 520px); max-height: 90vh; max-height: 90dvh; border: 1px solid #cfdcd1; border-radius: 18px; padding: 18px; color: var(--text); box-shadow: 0 17px 55px #18272252; }
dialog::backdrop { background: #1c2c28a3; }
.dialog-header { margin-bottom: 8px; }
.settings-block { margin-top: 14px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.settings-block legend { padding: 0 4px; }
.settings-block label { margin-top: 8px; }
.settings-hint, #file-scope { margin-top: 6px; }
.advanced-settings { margin-top: 10px; }
.advanced-settings summary { cursor: pointer; color: var(--forest); font-size: .84rem; }
.advanced-settings label { display: block; margin-bottom: 6px; }
.oauth-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.oauth-actions .button { flex: 1 1 auto; }
.connection-details { margin-top: 9px; border: 1px solid var(--line); border-radius: 12px; }
.connection-details > summary { cursor: pointer; min-height: 42px; padding: 9px 11px; color: #274b3e; font-size: .9rem; font-weight: 700; }
.connection-fields { margin: 0; padding-top: 0; border: 0; }
.connection-fields label { display: block; margin-bottom: 6px; }
.connections-save { position: sticky; z-index: 1; bottom: -18px; margin: 10px -4px -7px; padding: 8px 4px 7px; border-top: 1px solid var(--line); background: var(--paper); }
.connections-save .notice { margin: 0 0 8px; }
.file-list { margin-top: 6px; }
.files { list-style: none; padding: 0; margin: 0; }
.files li + li { border-top: 1px solid var(--line); }
.file-button { border: 0; border-radius: 8px; min-height: 44px; width: 100%; display: flex; align-items: center; text-align: left; gap: 9px; padding: 6px 8px; color: var(--text); background: transparent; }
.file-button:hover:not(:disabled) { background: #edf5eb; }
.file-type { flex: 0 0 53px; text-align: center; color: #3d6250; font-size: .72rem; font-weight: 600; border-radius: 6px; background: #e5f0e6; padding: 3px 3px; }
.file-name { min-width: 0; overflow-wrap: anywhere; font-size: .88rem; }
.up-button { margin: 4px 0; }

@media (max-width: 790px) {
  .layout { width: calc(100% - 40px); }
  .hero { padding: 24px; min-height: 200px; }
  .hero-decoration { width: 30%; }
  .hero-decoration::before { width: 210px; }
  .hero-decoration::after { width: 260px; }
  .hero-decoration .speaker-art { scale: .82; }
  .card { padding: 16px; }
}
@media (max-width: 660px) {
  .dashboard { grid-template-columns: minmax(0, 1fr); gap: 12px; padding-bottom: 20px; }
  .dashboard-right { gap: 12px; }
  .nav { min-height: 57px; }
  .hero { margin: 16px 0 12px; }
  .hero-note { max-width: 24em; }
}
@media (max-width: 550px) {
  .mobile-break { display: initial; }
  .hero-note { max-width: 19em; }
}
@media (max-width: 470px) {
  .layout { width: calc(100% - 24px); }
  .topbar .layout { width: calc(100% - 30px); }
  .hero { padding: 18px; min-height: 190px; border-radius: 16px; }
  .hero h1 { font-size: clamp(1.9rem, 8vw, 2.35rem); }
  .hero-note { font-size: .81rem; max-width: 17em; }
  .mobile-break { display: initial; }
  .hero-decoration { width: 40%; }
  .hero-decoration::before, .hero-decoration::after { left: 59%; }
  .hero-decoration .speaker-art { left: 59%; scale: .61; }
  .card { border-radius: 16px; }
  .source-options { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .source-options label { grid-column: span 2; }
  .source-options label:nth-child(-n+2) { grid-column: span 3; }
  .login-view { grid-template-columns: 1fr; }
  .login-decoration { min-height: 109px; }
  .login-decoration .speaker-art { scale: .63; }
}
@media (max-width: 345px) {
  .hero-decoration { opacity: .5; }
  .hero-note { max-width: 16em; }
  .card { padding: 12px; }
  .nav-button { padding-inline: 7px; }
}
