:root {
    --bg: #f4f6f3;
    --surface: #ffffff;
    --surface-muted: #eef2ed;
    --line: #dce4dc;
    --line-strong: #c8d4ca;
    --ink: #17211b;
    --muted: #66726a;
    --accent: #167a54;
    --accent-strong: #0f6041;
    --accent-soft: #e4f2eb;
    --student-accent: #167a54;
    --student-soft: #e4f2eb;
    --blue: #35728f;
    --blue-soft: #e7f1f5;
    --amber: #8a6818;
    --amber-soft: #f7efd8;
    --red: #a5483b;
    --red-soft: #f8e9e6;
    --shadow: 0 8px 24px rgba(38, 55, 44, 0.06);
}

* {
    box-sizing: border-box;
    letter-spacing: 0 !important;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 88px;
}

body {
    min-height: 100dvh;
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    font-family: "Segoe UI Variable", "Microsoft YaHei UI", "PingFang SC", sans-serif;
    line-height: 1.5;
}

button,
select,
textarea,
input {
    font: inherit;
}

button,
select,
summary {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
select:focus-visible,
textarea:focus-visible,
input:focus-visible,
a:focus-visible,
summary:focus-visible {
    outline: 3px solid rgba(22, 122, 84, 0.24);
    outline-offset: 2px;
}

.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 100;
    padding: 8px 12px;
    border-radius: 6px;
    color: #fff;
    background: var(--ink);
    transform: translateY(-150%);
}

.skip-link:focus {
    transform: translateY(0);
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 30;
    border-bottom: 1px solid rgba(200, 212, 202, 0.9);
    background: rgba(244, 246, 243, 0.94);
    backdrop-filter: blur(16px);
}

.app-header-inner {
    width: min(1280px, calc(100% - 32px));
    min-height: 68px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 28px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    text-decoration: none;
}

.brand img {
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    object-fit: cover;
}

.brand span {
    display: grid;
    line-height: 1.15;
}

.brand strong {
    font-size: 15px;
    font-weight: 700;
}

.brand small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
}

.primary-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.primary-nav a {
    padding: 8px 12px;
    border-radius: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: color 180ms ease, background 180ms ease;
}

.primary-nav a:hover,
.primary-nav a.active {
    color: var(--accent-strong);
    background: var(--accent-soft);
}

.device-binding {
    min-width: 174px;
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 16px;
    border-left: 1px solid var(--line);
}

.device-binding-indicator {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.device-binding.is-pending .device-binding-indicator {
    background: var(--muted);
    box-shadow: 0 0 0 4px var(--surface-muted);
}

.device-binding-copy {
    min-width: 0;
    display: grid;
    line-height: 1.2;
}

.device-binding-copy small {
    color: var(--muted);
    font-size: 10px;
}

.device-binding-copy strong {
    max-width: 180px;
    margin-top: 3px;
    overflow: hidden;
    font-size: 12px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-shell {
    width: min(1280px, calc(100% - 32px));
    margin: 22px auto 36px;
}

.student-hero {
    min-height: 142px;
    padding: 24px 26px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
}

.identity-block,
.identity-status,
.identity-actions,
.sync-line {
    display: flex;
    align-items: center;
}

.identity-block {
    min-width: 0;
    gap: 18px;
}

.profile-avatar {
    width: 82px;
    height: 82px;
    flex: 0 0 82px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    object-fit: contain;
}

.identity-copy {
    min-width: 0;
}

.section-kicker,
.eyebrow {
    margin: 0 0 5px;
    color: var(--accent-strong);
    font-size: 11px;
    font-weight: 700;
}

.identity-copy h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.2;
    font-weight: 720;
}

.identity-copy > p:last-child {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.identity-status {
    align-items: flex-end;
    flex-direction: column;
    gap: 16px;
}

.sync-line {
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
}

.sync-line strong {
    color: var(--ink);
    font-size: 13px;
}

.sync-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1b9c68;
    box-shadow: 0 0 0 4px rgba(27, 156, 104, 0.12);
}

.identity-actions {
    gap: 8px;
}

.status-pill,
.mini-pill {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 30px;
    padding: 5px 9px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
}

.status-good {
    color: #11603f;
    background: #e1f1e8;
}

.status-watch {
    color: #72530c;
    background: var(--amber-soft);
}

.status-alert {
    color: #873328;
    background: var(--red-soft);
}

.icon-text-btn,
.action-btn {
    min-height: 38px;
    border: 1px solid transparent;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
    transition: transform 160ms ease, background 180ms ease, border-color 180ms ease;
}

.icon-text-btn {
    color: var(--ink);
    border-color: var(--line-strong);
    background: #fff;
}

.icon-text-btn:disabled {
    color: #8a948d;
    border-color: var(--line);
    background: var(--surface-muted);
    cursor: not-allowed;
    transform: none;
}

.sync-now-btn {
    color: var(--accent-strong);
    border-color: #a9cbbb;
    background: var(--accent-soft);
}

.sync-now-icon {
    width: 17px;
    height: 17px;
    display: inline-grid;
    place-items: center;
    font-size: 18px;
    line-height: 1;
}

.sync-now-btn.is-syncing .sync-now-icon {
    animation: sync-rotate 900ms linear infinite;
}

@keyframes sync-rotate {
    to { transform: rotate(360deg); }
}

.icon-text-btn:hover,
.action-btn.secondary:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.icon-text-btn:active,
.action-btn:active {
    transform: translateY(1px);
}

.icon-text-btn svg,
.action-btn svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.action-btn.primary {
    color: #fff;
    background: var(--accent);
}

.action-btn.primary:hover {
    background: var(--accent-strong);
}

.action-btn.secondary {
    color: var(--ink);
    border-color: var(--line-strong);
    background: #fff;
}

.action-btn:disabled {
    cursor: wait;
    opacity: 0.62;
}

.action-icon {
    width: 19px;
    height: 19px;
    border-radius: 4px;
}

.page-error {
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid #ebc3bc;
    border-radius: 6px;
    color: #873328;
    background: #fff3f1;
}

.summary-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.metric-card {
    position: relative;
    min-height: 132px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: var(--surface);
    box-shadow: 0 4px 14px rgba(38, 55, 44, 0.035);
}

.metric-card::before {
    content: none;
}

.metric-card.good { background: #edf8f2; }
.metric-card.sky { background: #eef4fb; }
.metric-card.warm { background: #fff7e7; }
.metric-card.rose { background: #fdf1f4; }

.metric-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.metric-value {
    margin-top: 8px;
    font-size: 29px;
    line-height: 1.15;
    font-weight: 720;
    font-variant-numeric: tabular-nums;
}

.metric-note {
    margin-top: 10px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.panel,
.report-brief {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.panel,
.report-brief {
    padding: 20px;
}

.full-span {
    grid-column: 1 / -1;
}

.wide {
    grid-column: span 8;
}

.chart-panel:not(.wide),
.narrative-panel {
    grid-column: span 4;
}

.timeline-panel.wide {
    grid-column: span 8;
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.panel-header h2,
.panel-header h3 {
    margin: 0;
    font-size: 17px;
    line-height: 1.25;
    font-weight: 700;
}

.panel-caption,
.source-summary {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.report-brief-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    border-top: 1px solid var(--line);
}

.brief-item {
    min-width: 0;
    padding: 15px 18px 2px 0;
}

.brief-item + .brief-item {
    padding-left: 18px;
    border-left: 1px solid var(--line);
}

.brief-item span,
.narrative-row > span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
}

.brief-item strong {
    display: block;
    margin-top: 7px;
    font-size: 14px;
    line-height: 1.55;
    font-weight: 650;
}

.chart-heading {
    align-items: center;
}

.panel-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.scope-switch {
    display: grid;
    grid-template-columns: repeat(4, auto);
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface-muted);
}

.scope-btn {
    min-height: 32px;
    padding: 5px 10px;
    border: 0;
    border-radius: 5px;
    color: var(--muted);
    background: transparent;
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
}

.scope-btn:hover,
.scope-btn.active {
    color: var(--accent-strong);
    background: #fff;
    box-shadow: 0 2px 6px rgba(38, 55, 44, 0.08);
}

.year-select-wrap {
    display: none;
    align-items: center;
    gap: 7px;
    font-size: 12px;
}

.chart-wrap {
    position: relative;
    width: 100%;
    height: 238px;
}

.chart-wrap.tall {
    height: 310px;
}

.narrative-panel,
.timeline-panel {
    min-height: 600px;
}

.narrative-stack {
    display: grid;
}

.narrative-row {
    padding: 16px 0;
    border-top: 1px solid var(--line);
}

.narrative-row p,
.bullet-list {
    margin: 8px 0 0;
    color: #415047;
    font-size: 13px;
    line-height: 1.7;
}

.bullet-list {
    padding-left: 18px;
}

.bullet-list li + li {
    margin-top: 7px;
}

.ai-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.timeline-list {
    max-height: 515px;
    overflow: auto;
    padding-right: 4px;
}

.timeline-item {
    position: relative;
    padding: 15px 0 15px 18px;
    border-top: 1px solid var(--line);
}

.timeline-item::before {
    content: "";
    position: absolute;
    top: 20px;
    left: 1px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--student-accent);
}

.timeline-item-header,
.timeline-item-body,
.collab-card-head,
.task-row,
.range-meta,
.toggle-row {
    display: flex;
    align-items: center;
}

.timeline-item-header,
.collab-card-head,
.task-row {
    justify-content: space-between;
    gap: 12px;
}

.timeline-item-title {
    font-size: 13px;
    font-weight: 700;
}

.timeline-item-time,
.timeline-item-body,
.mini-note {
    color: var(--muted);
    font-size: 12px;
}

.timeline-item-body {
    align-items: flex-start;
    gap: 8px;
    margin-top: 7px;
    line-height: 1.6;
}

.timeline-tag {
    flex: 0 0 auto;
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--blue);
    background: var(--blue-soft);
    font-size: 10px;
    font-weight: 700;
}

.timeline-tag.alert {
    color: var(--red);
    background: var(--red-soft);
}

.collaboration-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    border-top: 1px solid var(--line);
}

.collab-section {
    min-width: 0;
    padding: 18px 18px 0 0;
}

.collab-section + .collab-section {
    padding-left: 18px;
    border-left: 1px solid var(--line);
}

.collab-card-head h3 {
    margin: 0;
    font-size: 14px;
}

.mini-pill {
    color: var(--accent-strong);
    background: var(--accent-soft);
}

.task-list {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.task-title {
    font-size: 13px;
    font-weight: 650;
}

.task-meta {
    color: var(--muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.task-progress {
    height: 6px;
    margin-top: 7px;
    border-radius: 3px;
    overflow: hidden;
    background: var(--surface-muted);
}

.task-progress > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--student-accent);
}

.feedback-input,
.setting-input {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    color: var(--ink);
    background: #fff;
}

.feedback-input {
    min-height: 118px;
    margin: 14px 0 10px;
    padding: 11px 12px;
    resize: vertical;
    line-height: 1.6;
}

.setting-row {
    display: grid;
    gap: 7px;
    margin-top: 14px;
}

.setting-row label,
.toggle-row {
    color: #415047;
    font-size: 12px;
}

.setting-input {
    min-height: 38px;
    padding: 7px 10px;
}

.range-meta {
    gap: 10px;
}

.range-meta input {
    flex: 1;
    accent-color: var(--accent);
}

.toggle-row {
    gap: 8px;
    margin: 14px 0;
}

.toggle-row input {
    width: 17px;
    height: 17px;
    accent-color: var(--accent);
}

.digest-summary {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.app-footer {
    width: min(1280px, calc(100% - 32px));
    margin: 0 auto 24px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: var(--muted);
    font-size: 11px;
}

.app-footer div {
    display: flex;
    gap: 10px;
}

.app-footer strong {
    color: var(--ink);
}

.toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 60;
    max-width: 340px;
    padding: 11px 13px;
    border-radius: 6px;
    color: #fff;
    background: #17211b;
    box-shadow: 0 14px 30px rgba(23, 33, 27, 0.22);
    font-size: 13px;
}

.hidden {
    display: none !important;
}

.is-loading .metric-value,
.is-loading .brief-item strong,
.is-loading .chart-wrap,
.is-loading .timeline-list {
    color: transparent;
    border-radius: 5px;
    background: #e9eeea;
    animation: skeleton-pulse 1.3s ease-in-out infinite alternate;
}

@keyframes skeleton-pulse {
    to { background-color: #dfe7e1; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (max-width: 1060px) {
    .app-header-inner {
        grid-template-columns: auto 1fr;
        gap: 14px;
        padding: 10px 0;
    }

    .primary-nav {
        order: 3;
        grid-column: 1 / -1;
        overflow-x: auto;
    }

    .device-binding {
        justify-self: end;
    }

    .student-hero {
        grid-template-columns: 1fr;
    }

    .identity-status {
        align-items: flex-start;
    }

    .summary-strip,
    .report-brief-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .brief-item:nth-child(3) {
        padding-left: 0;
        border-left: 0;
    }

    .brief-item:nth-child(n+3) {
        padding-top: 16px;
        border-top: 1px solid var(--line);
    }

    .content-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .full-span,
    .wide,
    .chart-panel:not(.wide),
    .narrative-panel,
    .timeline-panel.wide {
        grid-column: span 1;
    }

    .full-span,
    .wide,
    .timeline-panel.wide,
    .collaboration-panel {
        grid-column: 1 / -1;
    }

    .narrative-panel,
    .timeline-panel {
        min-height: 0;
    }

    .collaboration-grid {
        grid-template-columns: 1fr;
    }

    .collab-section,
    .collab-section + .collab-section {
        padding: 18px 0;
        border-left: 0;
        border-top: 1px solid var(--line);
    }

    .collab-section:first-child {
        border-top: 0;
    }
}

@media (max-width: 680px) {
    .app-header-inner,
    .page-shell,
    .app-footer {
        width: min(100% - 20px, 1280px);
    }

    .app-header-inner {
        grid-template-columns: 1fr;
    }

    .device-binding {
        width: 100%;
        min-height: 0;
        justify-self: stretch;
        padding: 10px 0 0;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .primary-nav {
        order: 2;
        grid-column: auto;
    }

    .device-binding {
        order: 3;
    }

    .page-shell {
        margin-top: 12px;
    }

    .student-hero {
        padding: 18px;
        gap: 18px;
    }

    .profile-avatar {
        width: 64px;
        height: 64px;
        flex-basis: 64px;
    }

    .identity-copy h1 {
        font-size: 23px;
    }

    .sync-line {
        flex-wrap: wrap;
    }

    .identity-actions {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .icon-text-btn {
        width: 100%;
    }

    .summary-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .metric-card {
        min-height: 118px;
        padding: 14px;
    }

    .metric-value {
        font-size: 24px;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .full-span,
    .wide,
    .chart-panel:not(.wide),
    .narrative-panel,
    .timeline-panel.wide {
        grid-column: span 1;
    }

    .panel,
    .report-brief {
        padding: 16px;
    }

    .report-brief-grid {
        grid-template-columns: 1fr;
    }

    .brief-item,
    .brief-item + .brief-item,
    .brief-item:nth-child(3),
    .brief-item:nth-child(n+3) {
        padding: 13px 0;
        border-left: 0;
        border-top: 1px solid var(--line);
    }

    .chart-heading,
    .panel-header-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .scope-switch {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .scope-btn {
        padding-inline: 4px;
    }

    .chart-wrap.tall {
        height: 270px;
    }

    .app-footer,
    .app-footer div {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 420px) {
    .summary-strip {
        grid-template-columns: 1fr;
    }
}

.auth-gate {
    min-height: 100dvh;
    display: grid;
    grid-template-columns: minmax(300px, 38%) minmax(0, 1fr);
    background: var(--surface);
}

.auth-brand-pane {
    min-height: 100%;
    padding: clamp(32px, 6vw, 84px);
    display: flex;
    align-items: flex-start;
    gap: 20px;
    color: #fff;
    background: #17392c;
}

.auth-brand-pane img {
    width: 92px;
    height: 92px;
    flex: 0 0 92px;
    border-radius: 8px;
    object-fit: cover;
}

.auth-brand-pane div {
    display: grid;
    gap: 5px;
    padding-top: 10px;
}

.auth-brand-pane strong {
    font-size: clamp(24px, 3vw, 38px);
    line-height: 1.15;
    font-weight: 700;
}

.auth-brand-pane span {
    color: #c8d9d0;
    font-size: 15px;
}

.auth-form-pane {
    width: min(100%, 620px);
    min-height: 100%;
    padding: clamp(36px, 7vw, 96px) clamp(28px, 8vw, 112px);
    display: flex;
    align-items: center;
}

.auth-view {
    width: 100%;
    max-width: 420px;
}

.auth-view h1 {
    margin: 7px 0 8px;
    font-size: clamp(30px, 4vw, 44px);
    line-height: 1.15;
    font-weight: 700;
    text-wrap: balance;
}

.auth-subtitle {
    margin: 0 0 28px;
    color: var(--muted);
    font-size: 14px;
}

.auth-mode-switch {
    width: fit-content;
    margin-bottom: 34px;
    padding: 3px;
    display: grid;
    grid-template-columns: repeat(2, 72px);
    border-radius: 6px;
    background: var(--surface-muted);
}

.auth-mode-switch button {
    min-height: 36px;
    border: 0;
    border-radius: 4px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    transition: color 180ms ease, background 180ms ease, transform 120ms ease;
}

.auth-mode-switch button.active {
    color: var(--accent-strong);
    background: var(--surface);
    box-shadow: 0 2px 8px rgba(38, 55, 44, 0.08);
}

.auth-mode-switch button:active,
.auth-primary-btn:active,
.text-button:active,
.header-icon-btn:active {
    transform: translateY(1px);
}

#authForm,
#bindingForm {
    display: grid;
    gap: 18px;
}

.auth-field {
    display: grid;
    gap: 8px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
}

.auth-field input {
    width: 100%;
    min-height: 48px;
    padding: 0 13px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    color: var(--ink);
    background: var(--surface);
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.auth-field input:hover {
    border-color: #9eb1a2;
}

.auth-field input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    outline: 0;
}

.pairing-code-input {
    font-variant-numeric: tabular-nums;
    font-size: 20px !important;
    font-weight: 700 !important;
}

.auth-primary-btn {
    min-height: 48px;
    border: 0;
    border-radius: 6px;
    color: #fff;
    background: var(--accent);
    font-weight: 700;
    cursor: pointer;
    transition: background 180ms ease, transform 120ms ease;
}

.auth-primary-btn:hover {
    background: var(--accent-strong);
}

.auth-primary-btn:disabled {
    cursor: wait;
    opacity: 0.62;
}

.form-error {
    margin: -4px 0 0;
    padding: 10px 12px;
    border-radius: 6px;
    color: #7b3028;
    background: var(--red-soft);
    font-size: 13px;
}

.binding-account-row {
    margin-bottom: 38px;
    padding-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line);
}

.binding-account-row span {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.binding-account-row small,
.account-identity small {
    color: var(--muted);
    font-size: 10px;
}

.binding-account-row strong,
.account-identity strong {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-button {
    border: 0;
    color: var(--accent-strong);
    background: transparent;
    font-weight: 600;
    cursor: pointer;
}

.header-account-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-account-area .device-binding {
    min-width: 168px;
    min-height: 44px;
    padding: 7px 10px;
    border: 0;
    border-radius: 6px;
    background: var(--surface-muted);
}

.account-identity {
    max-width: 150px;
    display: grid;
    line-height: 1.2;
}

.header-icon-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--muted);
    background: var(--surface);
    cursor: pointer;
    transition: color 180ms ease, border-color 180ms ease, background 180ms ease, transform 120ms ease;
}

.header-icon-btn:hover {
    color: var(--accent-strong);
    border-color: var(--line-strong);
    background: var(--accent-soft);
}

.header-icon-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

@media (max-width: 1060px) {
    .account-identity {
        display: none;
    }
}

@media (max-width: 760px) {
    .auth-gate {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .auth-brand-pane {
        min-height: 138px;
        padding: 24px;
        align-items: center;
    }

    .auth-brand-pane img {
        width: 64px;
        height: 64px;
        flex-basis: 64px;
    }

    .auth-brand-pane div {
        padding-top: 0;
    }

    .auth-form-pane {
        width: 100%;
        padding: 42px 24px 56px;
        align-items: flex-start;
        justify-content: center;
    }

    .auth-mode-switch {
        margin-bottom: 28px;
    }
}
