
/* ========== Preview app shell ========== */
.preview-app { display: flex; height: 100vh; overflow: hidden; }
.preview-side {
    width: 236px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
}
.preview-brand {
    height: 72px; padding: 0 20px; border-bottom: 1px solid var(--border-light);
    display: flex; flex-direction: column; justify-content: center;
}
.preview-brand-title { font-size: 16px; font-weight: 700; letter-spacing: -.015em; line-height: 1.25; }
.preview-brand-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.preview-nav { flex: 1; overflow-y: auto; padding: 12px; }
.preview-nav-group {
    padding: 16px 8px 6px; font-size: 12px; font-weight: 700; color: var(--text-tertiary);
    letter-spacing: .05em; text-transform: uppercase;
}
.preview-nav-group:first-child { padding-top: 4px; }
.preview-nav-item {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 8px 10px; border-radius: 4px; border: 0; background: transparent;
    font-size: 13px; color: var(--text-secondary); text-align: left;
}
.preview-nav-item:hover { background: var(--hover); color: var(--text-primary); }
.preview-nav-item.active { background: var(--brand-weak); color: var(--primary); font-weight: 500; }
.preview-nav-item .nav-ico { width: 16px; height: 16px; flex-shrink: 0; color: var(--text-tertiary); }
.preview-nav-item.active .nav-ico { color: var(--primary); }
.preview-nav-sub { margin-left: 16px; border-left: 1px solid var(--border-light); padding-left: 8px; display: flex; flex-direction: column; gap: 2px; }
.preview-nav-sub .preview-nav-item { padding: 7px 10px; font-size: 12px; }
.preview-side-foot {
    padding: 14px 20px; border-top: 1px solid var(--border-light); font-size: 12px; color: var(--text-tertiary);
}
.preview-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.preview-topbar {
    height: 56px; flex-shrink: 0; background: #fff; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between; padding: 0 20px; gap: 16px;
}
.topbar-title { display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 650; line-height: 1.3; min-width: 0; }
.topbar-badge {
    font-size: 11px; font-weight: 500; color: var(--primary); background: var(--brand-weak);
    padding: 3px 8px; border-radius: 20px; white-space: nowrap;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.viewport-label { font-size: 12px; color: var(--text-tertiary); margin-right: 4px; }
.vp-btn {
    height: 30px; padding: 0 12px; border-radius: 4px; border: 1px solid var(--border);
    background: #fff; color: var(--text-secondary); font-size: 12px;
}
.vp-btn:hover { background: var(--hover); }
.vp-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.preview-stage { flex: 1; overflow-y: auto; padding: 20px; }
.figma-mode .preview-side,
.figma-mode .preview-topbar { display: none; }
.figma-mode .preview-main { height: 100vh; }
.figma-mode .preview-stage { padding: 0; overflow: hidden; }
.figma-mode .page-stage { height: 100vh; min-height: 100vh; border: none; border-radius: 0; }

/* ========== Boards ========== */
.board { display: flex; flex-direction: column; gap: 16px; max-width: 1480px; margin: 0 auto; }
.board-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.board-title { font-size: 22px; font-weight: 700; line-height: 1.25; }
.board-sub { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.doc-badge {
    flex-shrink: 0; font-size: 12px; color: var(--text-secondary); background: #fff;
    border: 1px solid var(--border); border-radius: 20px; padding: 5px 12px;
}
.section-card {
    background: #fff; border: 1px solid var(--border); border-radius: 4px;
    box-shadow: var(--shadow-card); overflow: hidden;
}
.section-card-head {
    padding: 15px 20px; border-bottom: 1px solid var(--border-light);
    display: flex; align-items: center; gap: 10px;
}
.section-card-title { font-size: 15px; font-weight: 600; }
.section-card-sub { font-size: 12px; color: var(--text-tertiary); margin-left: auto; }
.section-card-body { padding: 20px; }
.doc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.doc-kv { display: flex; flex-direction: column; gap: 10px; }
.doc-kv-row { display: flex; gap: 12px; font-size: 13px; }
.doc-kv-label { width: 104px; flex-shrink: 0; color: var(--text-secondary); }
.doc-kv-value { color: var(--text-primary); }
.doc-list { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.doc-list li { display: flex; gap: 8px; }
.doc-list .ok { color: var(--success); font-weight: 700; }
.doc-list .warn { color: var(--warning); font-weight: 700; }
.doc-note {
    font-size: 13px; color: var(--text-secondary); background: #f8fafc; border: 1px solid var(--border-light);
    border-radius: 4px; padding: 12px 14px;
}

/* ========== Tokens ========== */
.token-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.swatch { border: 1px solid var(--border); border-radius: 4px; overflow: hidden; background: #fff; }
.swatch-color { height: 54px; }
.swatch-meta { padding: 8px 10px; }
.swatch-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.swatch-val { font-size: 11px; color: var(--text-secondary); font-family: var(--font-mono); margin-top: 2px; }
.type-row { display: flex; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border-light); }
.type-row:last-child { border-bottom: 0; }
.type-demo { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.type-token { width: 150px; flex-shrink: 0; font-size: 12px; color: var(--text-secondary); font-family: var(--font-mono); }
.space-row { display: flex; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border-light); }
.space-row:last-child { border-bottom: 0; }
.space-bar { height: 18px; background: var(--brand-weak); border: 1px solid #c9daff; border-radius: 4px; flex-shrink: 0; }
.space-label { width: 140px; font-size: 12px; color: var(--text-secondary); }
.radius-row { display: flex; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border-light); }
.radius-row:last-child { border-bottom: 0; }
.radius-box { width: 56px; height: 56px; background: var(--brand-weak); border: 1px solid #c9daff; flex-shrink: 0; }
.shadow-demo { width: 220px; height: 64px; background: #fff; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--text-tertiary); }

/* ========== States board ========== */
.inter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.state-card { background: #fff; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; box-shadow: var(--shadow-card); }
.state-card-head { padding: 10px 14px; border-bottom: 1px solid var(--border-light); font-size: 13px; font-weight: 600; display: flex; justify-content: space-between; gap: 8px; }
.state-card-head .code { font-size: 11px; font-weight: 400; color: var(--text-tertiary); font-family: Consolas, monospace; }
.state-card-body { padding: 18px; min-height: 130px; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }

/* ========== Prototypes ========== */
.proto-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; }
.proto-card { background: #fff; border: 1px solid var(--border); border-radius: 4px; box-shadow: var(--shadow-card); overflow: hidden; }
.proto-card-head { padding: 14px 18px; border-bottom: 1px solid var(--border-light); display: flex; align-items: center; gap: 10px; }
.proto-card-title { font-size: 15px; font-weight: 600; }
.proto-card-sub { font-size: 12px; color: var(--text-tertiary); }
.proto-card-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.flow-step { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 4px; border: 1px solid var(--border-light); background: var(--bg-page); text-align: left; }
.flow-step:hover { border-color: var(--primary); background: var(--brand-weak); }
.flow-step .num { width: 26px; height: 26px; border-radius: 4px; background: #fff; border: 1px solid var(--border); color: var(--text-secondary); font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.flow-step .text { flex: 1; min-width: 0; }
.flow-step .step-title { font-size: 13px; font-weight: 500; }
.flow-step .step-desc { font-size: 11px; color: var(--text-tertiary); margin-top: 1px; }
.flow-step .go { color: var(--primary); font-size: 12px; flex-shrink: 0; }
.flow-arrow { margin: 0 auto; color: var(--text-tertiary); font-size: 16px; line-height: 1; }

/* ========== Responsive ========== */
@media (max-width: 900px) {
    .preview-side { width: 200px; }
    .detail-layout { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .preview-app { display: block; overflow: auto; }
    .preview-side { width: 100%; border-right: 0; border-bottom: 1px solid var(--border); max-height: 260px; }
    .preview-nav { display: flex; flex-wrap: wrap; gap: 4px; }
    .preview-nav-group { width: 100%; }
    .preview-nav-sub { margin-left: 4px; }
    .preview-main { min-height: calc(100vh - 260px); }
    .preview-stage { padding: 12px; }
    .page-stage { height: auto; min-height: 560px; }
    .kpi-panel { flex-wrap: wrap; }
    .kpi-total, .kpi-col { flex: 1 1 45%; border-left: 0; border-bottom: 1px solid var(--border-light); }
    .phone-frame { width: 375px !important; }
    .phone-screen { height: 680px !important; }
}

.detail-modal { width: min(880px, 100%); }
.detail-modal-mask { position: absolute; }
.detail-modal-body { gap: 18px; padding: 22px 24px 24px; }
.detail-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 2px 0 4px; }
.detail-hero-name { font-size: 20px; font-weight: 650; line-height: 1.3; }
.detail-hero-meta { display: flex; align-items: center; gap: 10px; color: var(--text-secondary); font-size: 13px; margin-top: 6px; flex-wrap: wrap; }
.detail-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }
.detail-photo-title { font-size: 14px; font-weight: 600; margin-top: 2px; }

@media (max-width: 720px) {
    .field-grid, .field-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
    .field-grid, .field-grid.cols-3 { grid-template-columns: 1fr; }
    .detail-hero { flex-direction: column; }
}

/* ========== Debug mode ========== */
.debug-toggle.active { background: #111827; border-color: #111827; color: #fff; }
.debug-on .preview-stage { margin-right: 324px; position: relative; }
.debug-on .desktop-app { width: var(--debug-dw, auto); max-width: 100%; margin: 0 auto; }
.debug-on .phone-frame { width: var(--debug-phone-w, 375px) !important; }
.debug-on .phone-screen { height: var(--debug-phone-h, auto) !important; min-height: 0; max-height: none; }

.debug-panel {
    position: fixed; top: 56px; right: 0; bottom: 0; width: 324px; z-index: 1200;
    background: #fff; border-left: 1px solid var(--border); box-shadow: -8px 0 24px rgba(15, 23, 42, .06);
    display: flex; flex-direction: column;
}
.figma-mode .debug-panel { display: none; }
.debug-panel-head {
    height: 48px; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between;
    padding: 0 14px; border-bottom: 1px solid var(--border);
}
.debug-panel-title { font-size: 13px; font-weight: 600; }
.debug-icon-btn {
    width: 28px; height: 28px; border-radius: 6px; border: 0; background: transparent;
    color: var(--text-secondary); display: inline-flex; align-items: center; justify-content: center; font-size: 16px;
}
.debug-icon-btn:hover { background: var(--hover); color: var(--text-primary); }
.debug-tabs { display: flex; gap: 4px; padding: 8px 10px 0; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.debug-tab-btn {
    flex: 1; height: 30px; border: 0; border-radius: 6px 6px 0 0; background: transparent;
    color: var(--text-secondary); font-size: 12px;
}
.debug-tab-btn:hover { color: var(--text-primary); }
.debug-tab-btn.active { background: var(--brand-weak); color: var(--primary); font-weight: 500; }
.debug-body { flex: 1; overflow-y: auto; padding: 12px; }
.debug-tab { display: none; }
.debug-tab.active { display: flex; flex-direction: column; gap: 12px; }
.debug-hint {
    font-size: 12px; color: var(--text-tertiary); line-height: 1.55;
    background: #f8fafc; border: 1px solid var(--border-light); border-radius: 8px; padding: 8px 10px;
}
.debug-empty {
    font-size: 12px; color: var(--text-tertiary); text-align: center; line-height: 1.7;
    padding: 24px 10px; border: 1px dashed var(--border-dark); border-radius: 8px;
}
.debug-section { border: 1px solid var(--border-light); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.debug-section-title {
    font-size: 11px; font-weight: 700; color: var(--text-tertiary);
    letter-spacing: .05em; text-transform: uppercase;
}
.debug-row { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.debug-row label { width: 52px; flex: 0 0 auto; font-size: 12px; color: var(--text-secondary); }
.debug-row input[type="number"],
.debug-row input[type="text"],
.debug-row select,
.debug-row textarea {
    flex: 1; min-width: 0; height: 28px; border: 1px solid var(--border); border-radius: 6px;
    padding: 0 8px; font-size: 12px; background: #fff; color: var(--text-primary);
}
.debug-row select { padding: 0 4px; }
.debug-row textarea { height: 64px; padding: 6px 8px; resize: vertical; }
.debug-row input[type="range"] { flex: 1; min-width: 0; accent-color: var(--primary); }
.debug-row .val { font-size: 11px; color: var(--text-tertiary); min-width: 42px; text-align: right; font-variant-numeric: tabular-nums; }
.debug-btn {
    height: 28px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--border);
    background: #fff; color: var(--text-secondary); font-size: 12px;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.debug-btn:hover { color: var(--primary); border-color: var(--primary); }
.debug-btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.debug-btn.primary:hover { background: var(--primary-hover); color: #fff; }
.debug-btn.primary.active { background: var(--primary-hover); }
.debug-btn.danger { color: var(--danger); }
.debug-btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.debug-target { display: flex; align-items: center; gap: 6px; }
.debug-target-name {
    flex: 1; min-width: 0; font-size: 12px; font-family: Consolas, Monaco, monospace; color: var(--primary);
    background: var(--brand-weak); border-radius: 6px; padding: 6px 8px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dbg-selected { outline: 2px solid var(--primary) !important; outline-offset: 1px !important; }
.dbg-hover { outline: 1px dashed rgba(51, 112, 255, .7) !important; outline-offset: 1px !important; }
@keyframes dbgFlash {
    0%, 100% { outline: 3px solid rgba(51, 112, 255, .95) !important; }
    50% { outline: 3px solid rgba(245, 158, 11, .95) !important; }
}
.dbg-flash { animation: dbgFlash .6s ease 2; }
.debug-note-pin {
    position: absolute; width: 24px; height: 24px; border-radius: 50%; background: #ef4444; color: #fff;
    border: 2px solid #fff; box-shadow: 0 2px 8px rgba(239, 68, 68, .5);
    font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 500;
}
.debug-note-pin:hover { transform: scale(1.15); }
.debug-note-pin.selected { background: var(--primary); }
.debug-note-list { display: flex; flex-direction: column; gap: 8px; }
.debug-note-item { border: 1px solid var(--border-light); border-radius: 8px; padding: 8px; background: #fff; }
.debug-note-item.selected { border-color: var(--primary); }
.debug-note-head { display: flex; align-items: center; gap: 8px; }
.debug-note-no {
    width: 22px; height: 22px; border-radius: 50%; background: var(--danger-weak); color: var(--danger);
    font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.debug-note-meta { flex: 1; min-width: 0; font-size: 11px; color: var(--text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.debug-note-text { font-size: 12px; color: var(--text-primary); margin-top: 6px; line-height: 1.5; word-break: break-all; }
.debug-note-actions { display: flex; gap: 6px; margin-top: 6px; }
.debug-export-result {
    font-size: 12px; line-height: 1.55; color: #047857; background: #ecfdf5;
    border: 1px solid #a7f3d0; border-radius: 8px; padding: 8px 10px; display: none;
}
.debug-export-result.show { display: block; }
.debug-export-pre {
    font-size: 11px; line-height: 1.5; font-family: Consolas, Monaco, monospace; color: var(--text-primary);
    background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 8px;
    max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-all; margin: 0;
}

@media (max-width: 1100px) {
    .debug-panel { width: 300px; }
    .debug-on .preview-stage { margin-right: 300px; }
}
@media (max-width: 900px) {
    .debug-panel { width: 280px; }
    .debug-on .preview-stage { margin-right: 0; }
}


/* Keep technical identifiers visually distinct from Chinese UI copy. */
[style*="font-family:Consolas"],
[style*="font-family: Consolas"] {
    font-family: var(--font-mono) !important;
}


/* Direct DingTalk scan trigger and plan conflict states */
.m-fab-wrap {
    position: absolute;
    right: 16px;
    bottom: 84px;
    z-index: 25;
    display: flex;
    align-items: center;
    gap: 8px;
}
.m-fab-wrap .m-fab { position: static; }
.m-fab-label {
    padding: 6px 9px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .86);
    color: #fff;
    font-size: 12px;
    white-space: nowrap;
}
.scan-direct-note {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--brand-weak);
    color: var(--primary);
    font-size: 12px;
    line-height: 1.5;
    text-align: left;
}
.conflict-note { align-items: flex-start; }
.conflict-note strong { display: block; font-weight: 600; }
.conflict-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    border: 1px solid #fecaca;
    border-radius: 8px;
    background: #fff7f7;
}
.conflict-list-head,
.conflict-row {
    display: grid;
    grid-template-columns: 1fr 1.35fr;
    gap: 10px;
    align-items: start;
}
.conflict-list-head {
    color: var(--text-tertiary);
    font-size: 11px;
}
.conflict-row {
    padding: 8px 0;
    border-top: 1px solid #fee2e2;
    font-size: 12px;
    color: var(--text-secondary);
}
.conflict-row b,
.conflict-row small {
    display: block;
}
.conflict-row small {
    margin-top: 3px;
    color: var(--text-tertiary);
}
.conflict-code {
    color: var(--danger);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.conflict-help {
    margin-top: 3px;
    color: #b45309;
    font-size: 12px;
    line-height: 1.5;
}
.conflict-state-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
}
/* Read-first mobile asset detail and confirmation guard */
.m-detail-actions {
    flex-wrap: wrap;
}
.m-detail-actions .m-bottom-hint {
    flex: 0 0 100%;
    color: var(--text-tertiary);
    font-size: 11px;
    line-height: 1.4;
    text-align: center;
}
.m-confirm-mask {
    position: absolute;
    inset: 0;
    z-index: 95;
    display: flex;
    align-items: flex-end;
    background: rgba(15, 23, 42, .52);
}
.m-confirm-sheet {
    width: 100%;
    padding: 18px 16px 22px;
    border-radius: 22px 22px 0 0;
    background: #fff;
    box-shadow: 0 -12px 30px rgba(15, 23, 42, .16);
}
.m-confirm-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.m-confirm-title {
    color: var(--text-primary);
    font-size: 17px;
    font-weight: 650;
}
.m-confirm-copy {
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.55;
}
.m-confirm-asset {
    margin-top: 14px;
    padding: 12px;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    background: var(--bg-page);
}
.m-confirm-asset-code {
    color: var(--primary);
    font-size: 12px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}
.m-confirm-asset-name {
    margin-top: 5px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
}
.m-confirm-asset-meta {
    margin-top: 5px;
    color: var(--text-tertiary);
    font-size: 12px;
}
.m-confirm-warning {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin-top: 12px;
    color: #b45309;
    font-size: 12px;
    line-height: 1.5;
}
.m-confirm-warning svg {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    margin-top: 1px;
}
.m-confirm-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}
.m-confirm-actions .btn {
    flex: 1;
}
/* ========== Authentication, access masks and mobile permission center ========== */
.auth-screen {
    min-height: 100%;
    background: linear-gradient(135deg, #f7faff 0%, #eef4ff 52%, #f8fafc 100%);
    color: var(--text-primary);
    overflow: auto;
}
.auth-screen-desktop { display: flex; flex-direction: column; padding: 0 6vw; }
.auth-topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.auth-brand { display: flex; align-items: center; gap: 10px; }
.auth-brand-mark { width: 34px; height: 34px; border-radius: 4px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 700; box-shadow: 0 8px 18px rgba(51, 112, 255, .2); }
.auth-brand-title { font-size: 15px; font-weight: 700; line-height: 1.25; }
.auth-brand-sub { margin-top: 2px; color: var(--text-tertiary); font-size: 11px; }
.auth-topbar-note { color: var(--text-tertiary); font-size: 12px; }
.auth-desktop-main { flex: 1; width: min(1040px, 100%); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) 400px; align-items: center; gap: clamp(40px, 8vw, 120px); padding: 34px 0 48px; }
.auth-desktop-copy { max-width: 560px; }
.auth-eyebrow { color: var(--primary); font-size: 11px; font-weight: 700; letter-spacing: .14em; }
.auth-desktop-copy h1 { margin: 14px 0 16px; font-family: var(--font-display); font-size: clamp(34px, 4vw, 52px); line-height: 1.15; letter-spacing: -.04em; }
.auth-desktop-copy h1 em { color: var(--primary); font-style: normal; }
.auth-desktop-copy p { max-width: 480px; margin: 0; color: var(--text-secondary); font-size: 16px; line-height: 1.8; }
.auth-benefits { display: grid; gap: 14px; margin-top: 34px; }
.auth-benefits > div { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 10px; align-items: center; }
.auth-benefits > div > span { grid-row: span 2; width: 28px; height: 28px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: #fff; color: var(--primary); border: 1px solid #dbeafe; }
.auth-benefits svg { width: 15px; height: 15px; }
.auth-benefits b { font-size: 13px; }
.auth-benefits small { color: var(--text-tertiary); font-size: 12px; }
.auth-card { width: 100%; padding: 30px; border: 1px solid rgba(203, 213, 225, .8); border-radius: 18px; background: rgba(255, 255, 255, .96); box-shadow: 0 20px 50px rgba(30, 64, 175, .12); }
.auth-card-kicker { color: var(--primary); font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.auth-card-title { margin-top: 8px; font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: -.025em; }
.auth-card-copy { margin-top: 8px; color: var(--text-secondary); font-size: 13px; line-height: 1.6; }
.auth-login-provider { display: flex; align-items: center; gap: 12px; margin-top: 22px; padding: 13px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg-page); }
.auth-dingtalk-mark { width: 34px; height: 34px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; border-radius: 4px; background: #1677ff; color: #fff; font-size: 17px; font-weight: 700; }
.auth-login-provider b, .auth-login-provider span { display: block; }
.auth-login-provider b { font-size: 13px; }
.auth-login-provider span { margin-top: 2px; color: var(--text-tertiary); font-size: 11px; }
.auth-login-btn { width: 100%; justify-content: center; margin-top: 18px; height: 44px; }
.auth-card-note { margin-top: 12px; text-align: center; color: var(--text-tertiary); font-size: 11px; line-height: 1.5; }
.auth-footer { display: flex; justify-content: space-between; gap: 16px; padding: 0 0 22px; color: var(--text-tertiary); font-size: 11px; }

.auth-mobile-page { min-height: 100%; display: flex; flex-direction: column; align-items: center; padding: 42px 20px 32px; background: linear-gradient(180deg, #f4f7ff 0%, #f8fafc 55%, #fff 100%); }
.auth-mobile-brand { text-align: center; }
.auth-mobile-brand .auth-brand-mark { margin: 0 auto 10px; }
.auth-mobile-brand .auth-brand-title { font-size: 18px; }
.auth-mobile-brand .auth-brand-sub { font-size: 12px; }
.auth-mobile-card { width: 100%; margin-top: 30px; padding: 22px 18px; border: 1px solid var(--border); border-radius: 18px; background: rgba(255, 255, 255, .97); box-shadow: 0 14px 34px rgba(15, 23, 42, .08); }
.auth-mobile-card .auth-card-title { font-size: 21px; }
.auth-mobile-card .auth-card-copy { font-size: 13px; }
.auth-mobile-steps { display: grid; gap: 11px; margin-top: 22px; }
.auth-mobile-steps > div { display: flex; align-items: center; gap: 10px; color: var(--text-secondary); font-size: 13px; }
.auth-mobile-steps span { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--brand-weak); color: var(--primary); font-size: 11px; font-weight: 700; }
.auth-mobile-help { max-width: 280px; margin-top: 18px; text-align: center; color: var(--text-tertiary); font-size: 11px; line-height: 1.55; }

.auth-mask, .session-mask { position: absolute; inset: 0; z-index: 95; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(15, 23, 42, .56); backdrop-filter: blur(2px); }
.auth-dialog, .session-dialog { width: min(440px, 100%); border-radius: 18px; background: #fff; box-shadow: 0 22px 70px rgba(15, 23, 42, .28); }
.auth-dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 20px 22px 14px; border-bottom: 1px solid var(--border-light); }
.auth-dialog-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; }
.auth-dialog-title svg { width: 17px; height: 17px; color: var(--primary); }
.auth-dialog-sub { margin-top: 3px; color: var(--text-tertiary); font-size: 11px; }
.auth-provider-panel { display: flex; gap: 12px; align-items: center; margin: 20px 22px 0; padding: 14px; border-radius: 4px; background: var(--brand-weak); }
.auth-provider-copy { min-width: 0; }
.auth-provider-title { font-size: 14px; font-weight: 650; }
.auth-provider-desc { margin-top: 3px; color: var(--text-secondary); font-size: 11px; line-height: 1.5; }
.auth-scope-list { display: grid; gap: 8px; margin: 16px 22px 0; color: var(--text-secondary); font-size: 12px; }
.auth-scope-list > div { display: flex; align-items: center; gap: 8px; }
.auth-scope-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
.auth-submit { width: calc(100% - 44px); justify-content: center; margin: 20px 22px 0; height: 42px; }
.auth-dialog-foot { padding: 12px 22px 20px; text-align: center; color: var(--text-tertiary); font-size: 11px; }
.auth-loading-state { display: flex; align-items: center; gap: 14px; min-height: 220px; padding: 28px 30px; }
.auth-loading-title { font-size: 14px; font-weight: 650; }
.auth-loading-copy { margin-top: 5px; color: var(--text-secondary); font-size: 12px; line-height: 1.55; }
.auth-spinner, .btn-spinner { display: inline-block; width: 18px; height: 18px; flex: 0 0 auto; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: authSpin .7s linear infinite; }
.auth-spinner { color: var(--primary); }
@keyframes authSpin { to { transform: rotate(360deg); } }

.service-loading-banner { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 4px; background: var(--brand-weak); color: var(--text-primary); box-shadow: none; }
.service-live-dot { width: 10px; height: 10px; flex: 0 0 auto; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 0 rgba(51, 112, 255, .35); animation: servicePulse 1.5s ease-out infinite; }
.service-loading-main { min-width: 0; flex: 1; }
.service-loading-title, .service-demo-title { font-size: 13px; font-weight: 700; }
.service-loading-copy, .service-demo-copy { margin-top: 3px; color: var(--text-secondary); font-size: 11px; line-height: 1.45; }
.service-progress-indeterminate { position: relative; height: 4px; margin-top: 9px; overflow: hidden; border-radius: 999px; background: #dbeafe; }
.service-progress-indeterminate span { display: block; width: 38%; height: 100%; border-radius: inherit; background: var(--primary); animation: serviceSlide 1.15s ease-in-out infinite; }
.service-loading-cancel { flex: 0 0 auto; border: 0; padding: 5px 8px; border-radius: 4px; color: var(--text-tertiary); background: transparent; font-size: 11px; cursor: pointer; }
.service-loading-cancel:hover { color: var(--primary); background: #dbeafe; }
.service-state-demo { width: 100%; }
.service-demo-card { width: 100%; padding: 14px; border: 1px solid var(--border); border-radius: 4px; background: #fff; }
.service-demo-loading { border-color: #bfdbfe; background: #f8fbff; }
.service-demo-timeout { border-color: #fed7aa; background: #fffaf5; }
.service-demo-success { border-color: #bbf7d0; background: #f5fff8; }
.service-demo-idle { background: var(--bg-page); }
.service-demo-head { display: flex; align-items: flex-start; gap: 10px; }
.service-demo-status-icon { width: 20px; height: 20px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--primary); background: #dbeafe; font-size: 12px; font-weight: 800; }
.service-demo-timeout .service-demo-status-icon { color: #b45309; background: #ffedd5; }
.service-demo-success .service-demo-status-icon { color: #047857; background: #d1fae5; }
.service-demo-note { margin-top: 10px; color: var(--text-secondary); font-size: 11px; line-height: 1.55; }
.service-demo-card .state-row { margin-top: 12px; }
@keyframes servicePulse { 0% { box-shadow: 0 0 0 0 rgba(51, 112, 255, .35); } 70% { box-shadow: 0 0 0 7px rgba(51, 112, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(51, 112, 255, 0); } }
@keyframes serviceSlide { 0% { transform: translateX(-120%); } 50% { transform: translateX(120%); } 100% { transform: translateX(270%); } }

.session-mask { background: rgba(15, 23, 42, .62); }
.session-dialog { width: min(400px, 100%); padding: 28px; text-align: center; }
.session-icon { width: 42px; height: 42px; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: #b45309; background: #fef3c7; }
.session-icon svg { width: 20px; height: 20px; }
.session-title { font-size: 18px; font-weight: 700; }
.session-copy { margin-top: 8px; color: var(--text-secondary); font-size: 13px; line-height: 1.65; }
.session-actions { display: flex; gap: 8px; margin-top: 22px; }
.session-actions .btn { flex: 1; }

.state-overlay-preview { position: relative; width: 100%; min-height: 220px; overflow: hidden; border: 1px solid var(--border); border-radius: 4px; background: var(--bg-page); }
.state-overlay-preview .auth-mask, .state-overlay-preview .session-mask { position: absolute; padding: 10px; }
.state-overlay-preview .auth-dialog, .state-overlay-preview .session-dialog { transform: scale(.82); transform-origin: center; }
.overlay-guideline { width: 100%; padding: 4px 2px; color: var(--text-secondary); font-size: 12px; line-height: 1.65; }
.overlay-guideline-title { color: var(--text-primary); font-size: 14px; font-weight: 650; }
.overlay-guideline ul { margin: 10px 0 0; padding-left: 18px; }
.overlay-guideline li + li { margin-top: 7px; }
.overlay-guideline b { color: var(--text-primary); }

.m-admin-hero { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 4px 0 14px; padding: 18px; border-radius: 4px; background: linear-gradient(135deg, var(--brand-weak), var(--bg-page)); border: 1px solid var(--border); }
.m-admin-eyebrow { color: var(--primary); font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.m-admin-title { margin-top: 5px; font-size: 20px; font-weight: 700; }
.m-admin-subtitle { margin-top: 4px; color: var(--text-secondary); font-size: 12px; line-height: 1.5; }
.m-admin-hero-icon { width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; border-radius: 4px; color: var(--primary); background: #fff; }
.m-admin-hero-icon svg { width: 22px; height: 22px; }
.m-admin-section { margin-top: 12px; padding: 14px; border: 1px solid var(--border); border-radius: 4px; background: #fff; }
.m-admin-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.m-admin-section-title { font-size: 14px; font-weight: 650; }
.m-admin-section-sub { margin-top: 3px; color: var(--text-tertiary); font-size: 12px; line-height: 1.4; }
.m-admin-section-tag, .m-admin-count { flex: 0 0 auto; color: var(--primary); background: var(--brand-weak); border-radius: 999px; padding: 3px 8px; font-size: 12px; }
.m-admin-search { display: flex; gap: 8px; margin-top: 13px; }
.m-admin-search input { min-width: 0; flex: 1; height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: 4px; color: var(--text-primary); background: #fff; font-size: 12px; }
.m-admin-search-result { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding: 10px; border-radius: 4px; background: var(--bg-page); }
.m-admin-search-result b, .m-admin-search-result span { display: block; }
.m-admin-search-result b { font-size: 13px; }
.m-admin-search-result span { margin-top: 2px; color: var(--text-tertiary); font-size: 11px; }
.m-admin-user-list { display: grid; gap: 8px; margin-top: 12px; }
.m-admin-user { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border-light); }
.m-admin-user:first-child { border-top: 0; padding-top: 0; }
.m-admin-avatar { width: 32px; height: 32px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--primary); background: var(--brand-weak); font-size: 13px; font-weight: 700; }
.m-admin-user-main { min-width: 0; flex: 1; }
.m-admin-user-head { display: flex; align-items: center; gap: 7px; }
.m-admin-user-head b { font-size: 13px; }
.m-role-chip { padding: 2px 6px; border-radius: 999px; color: #047857; background: #ecfdf5; font-size: 10px; }
.m-role-chip.pending { color: #b45309; background: #fffbeb; }
.m-admin-user-meta { margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-tertiary); font-size: 12px; }
.m-admin-boundary { display: flex; align-items: flex-start; gap: 8px; margin: 12px 0 20px; padding: 12px; border: 1px solid var(--border); border-radius: 4px; color: var(--text-secondary); background: var(--brand-weak); font-size: 12px; line-height: 1.55; }
.m-admin-boundary > span { flex: 0 0 auto; color: var(--primary); }
.m-admin-boundary svg { width: 15px; height: 15px; }
.m-admin-boundary b { color: var(--text-primary); }
.m-admin-boundary p { margin: 3px 0 0; }

.auth-mask-mobile { align-items: flex-end; padding: 0; }
.auth-dialog-mobile { width: 100%; border-radius: 20px 20px 0 0; }
.auth-dialog-mobile .auth-dialog-head { padding-top: 17px; }
.auth-dialog-mobile .auth-loading-state { min-height: 180px; padding: 24px 22px 28px; }
.auth-mask-mobile .auth-dialog { max-height: 90%; overflow: auto; }

@media (max-width: 840px) {
    .auth-screen-desktop { padding: 0 28px; }
    .auth-desktop-main { grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; }
    .auth-desktop-copy h1 { font-size: 38px; }
}
@media (max-width: 700px) {
    .auth-screen-desktop { padding: 0 20px; }
    .auth-desktop-main { grid-template-columns: 1fr; gap: 26px; padding-top: 20px; }
    .auth-desktop-copy { display: none; }
    .auth-card { max-width: 420px; margin: 0 auto; }
    .auth-footer { padding-bottom: 18px; }
}
@media (max-width: 420px) {
    .auth-mobile-page { padding-left: 16px; padding-right: 16px; }
    .auth-dialog-head, .auth-provider-panel, .auth-scope-list { margin-left: 18px; margin-right: 18px; }
    .auth-submit { width: calc(100% - 36px); margin-left: 18px; margin-right: 18px; }
    .auth-dialog-foot { padding-left: 18px; padding-right: 18px; }
    .session-dialog { padding: 24px 18px; }
}