/* onenote2notion — Professional Tool Design System */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg: #eeeff2;
    --bg-surface: #fafafc;
    --bg-elevated: #e8e9ed;
    --border: #dcdce3;
    --border-active: #c4c4ce;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow: 0 1px 6px rgba(0,0,0,0.08);
    --text: #1a1a1e;
    --text-secondary: #5c5c66;
    --text-muted: #9999a3;
    --primary: #4f5fd4;
    --primary-hover: #3e4ec0;
    --primary-dim: rgba(79, 95, 212, 0.08);
    --primary-text: #ffffff;
    --success: #1da86b;
    --success-dim: rgba(29, 168, 107, 0.08);
    --warning: #e58a00;
    --danger: #d93030;
    --danger-dim: rgba(217, 48, 48, 0.07);
    --radius: 8px;
    --radius-sm: 6px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'SF Mono', 'JetBrains Mono', 'Cascadia Code', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.app {
    position: relative;
    padding: 0 24px;
    min-height: 100vh; display: flex; flex-direction: column;
}

/* 用户路由 /user 初始隐藏工作区面板，避免闪烁 */
body[data-initial-view="account"] .left-panel,
body[data-initial-view="account"] #wGuide1,
body[data-initial-view="account"] #wGuide2,
body[data-initial-view="account"] #workspaceTree {
    display: none !important;
}
body[data-initial-view="account"] #workspaceAccount {
    display: block !important;
}
body[data-initial-view="account"] .right-panel {
    padding-left: 0;
}

/* Header */
.header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 0; border-bottom: 1px solid var(--border); flex-shrink: 0;
    /* 让 header（含“工作区”导航）始终在付款弹层等全屏遮罩之上，
       付款成功后的弹层不会挡住导航点击 */
    position: relative;
    z-index: 130;
}
.header-right {
    display: flex; align-items: center; gap: 12px;
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.logo .app-logo {
    width: 32px;
    height: 32px;
}
.logo h1 {
    font-family: 'DM Serif Display', Georgia, 'Times New Roman', serif;
    font-size: 1.15rem; font-weight: 400; letter-spacing: -0.01em; color: var(--text);
}

/* Header Nav Tabs */
.header-nav {
    display: flex; align-items: center; gap: 4px;
}

.header-nav-item {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    outline: none;
    box-shadow: none;
    text-decoration: none;
}

.header-nav-item:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text);
}

.header-nav-item.active {
    background: var(--primary-dim);
    color: var(--primary);
    font-weight: 600;
    outline: none;
    box-shadow: none;
}

.header-user {
    position: relative;
}

/* Language Switcher (workspace — globe + dropdown) */
.lang-switcher { position: relative; }
.lang-switch-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 8px; border-radius: var(--radius-sm);
    font-size: 0.8rem; font-weight: 500; font-family: var(--font);
    color: var(--text-secondary); background: transparent; border: none;
    cursor: pointer; transition: color 0.15s;
}
.lang-switch-btn:hover { color: var(--text); }
.lang-switch-arrow {
    font-size: 9px; margin-left: 1px; display: inline-block;
    transition: transform 0.2s;
}
.lang-switch-btn[aria-expanded="true"] .lang-switch-arrow { transform: rotate(180deg); }
.lang-dropdown {
    position: absolute; right: 0; top: calc(100% + 10px);
    z-index: 200; min-width: 160px; padding: 6px;
    border-radius: var(--radius); border: 1px solid var(--border);
    background: var(--bg-surface);
    box-shadow: 0 4px 24px rgba(0,0,0,0.10), 0 1px 4px rgba(0,0,0,0.06);
}
.lang-option {
    display: flex; width: 100%; align-items: center; justify-content: space-between;
    padding: 9px 12px; border: none; border-radius: 8px;
    background: transparent; font-family: var(--font); font-size: 0.85rem;
    font-weight: 500; color: var(--text-secondary); cursor: pointer;
    transition: background 0.15s; text-align: left;
}
.lang-option:hover { background: rgba(0,0,0,0.05); }
.lang-option[aria-selected="true"] { font-weight: 700; color: var(--primary); }
.lang-option-check { color: var(--primary); display: none; }
.lang-option[aria-selected="true"] .lang-option-check { display: inline; }

.user-avatar-btn {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: var(--bg-surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.15s ease;
}

.user-avatar-btn:hover {
    border-color: var(--border-active);
    transform: translateY(-1px);
}

.user-avatar-btn[data-tip]:hover::after,
.user-avatar-btn[data-tip]:focus-visible::after {
    content: attr(data-tip);
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #1f2128;
    color: #f5f7fb;
    font-size: 0.72rem;
    line-height: 1.2;
    padding: 6px 8px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 1;
    z-index: 80;
}

.user-avatar-btn[data-tip]:hover::before,
.user-avatar-btn[data-tip]:focus-visible::before {
    content: '';
    position: absolute;
    top: calc(100% + 3px);
    right: 12px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid #1f2128;
    pointer-events: none;
    z-index: 80;
}

.user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f5fd4 0%, #2f3fb8 100%);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.user-avatar.is-guest {
    background: #b8bcc6;
    color: transparent;
    position: relative;
}

.user-avatar.is-guest::before {
    content: '';
    width: 14px;
    height: 14px;
    background: #f7f8fa;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 20c0-4 3.6-7 8-7s8 3 8 7v1H4z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 20c0-4 3.6-7 8-7s8 3 8 7v1H4z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.user-avatar-btn.guest-click {
    animation: guest-bounce 180ms ease-out;
}

@keyframes guest-bounce {
    0% { transform: scale(1); }
    45% { transform: scale(0.93); }
    100% { transform: scale(1); }
}

.user-menu {
    position: absolute;
    top: 42px;
    right: 0;
    width: 220px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 50;
    overflow: hidden;
}

.user-menu-info {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.user-menu-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.user-menu-id {
    margin-top: 2px;
    font-size: 0.73rem;
    color: var(--text-muted);
    word-break: break-all;
}

.user-menu-quota {
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
}

.user-menu-item {
    width: 100%;
    padding: 9px 12px;
    border: none;
    text-align: left;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
}

.user-menu-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

.user-menu-item.danger {
    color: var(--danger);
}

/* Hero */
.hero {
    flex-shrink: 0;
    margin: 0 -24px;
    background: linear-gradient(135deg, rgba(79, 95, 212, 0.10) 0%, rgba(124, 58, 237, 0.06) 100%);
    border-bottom: 1px solid var(--border);
}
.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    gap: 24px;
}
.hero-text h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}
.hero-text p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.hero-illustration {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    opacity: 0.9;
}

/* Main: Full-height Left/Right */
.main { display: flex; gap: 0; flex: 1; min-height: 0; max-width: 1440px; margin: 0 auto; width: 100%; }
.left-panel {
    width: 360px; flex-shrink: 0; border-right: 1px solid var(--border);
    padding: 24px 24px 24px 6px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 14px;
}
.right-panel {
    flex: 1; padding: 24px 0 24px 24px; overflow-y: auto;
}
.right-panel.full-width {
    padding-left: 0;
}

/* Workspace: Guide (interactive content area) */
.workspace-guide {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center;
    min-height: 360px;
    color: var(--text-secondary);
    gap: 12px;
}
.workspace-guide h3 { color: var(--text); font-size: 1rem; font-weight: 600; }
.workspace-guide > p { font-size: 0.82rem; max-width: 360px; }
.workspace-guide .device-code-box { max-width: 340px; margin: 0 auto; }
.workspace-guide .notion-setup-step { text-align: left; max-width: 380px; width: 100%; }
.workspace-guide .setup-input { max-width: 380px; }
.workspace-guide .success-badge { margin-top: 4px; }

/* Workspace: Placeholder (legacy) */
.workspace-placeholder {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center;
    height: 100%; min-height: 360px;
    color: var(--text-secondary);
}

.workspace-placeholder h3 {
    color: var(--text);
    margin-bottom: 12px;
}

.placeholder-steps {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 24px;
    text-align: left;
}

#authWorkflow {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.ph-step {
    padding: 10px 16px;
    background: rgba(0,0,0,0.03);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ph-step > span {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--primary-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* Main step (contains heading + button) */
.ph-step-main {
    flex-direction: column; align-items: flex-start;
    padding: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius);
    position: relative;
}
.ph-step-main > span {
    position: absolute; top: 12px; left: 14px;
}
.ph-step-body {
    padding-left: 34px;
}
.ph-step-body h3 {
    font-size: 0.92rem; font-weight: 600; color: var(--text);
    margin-bottom: 2px;
}
.ph-step-body p {
    font-size: 0.8rem; color: var(--text-secondary);
    margin-bottom: 10px;
}

.trust-note {
    margin: 0 0 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(16, 185, 129, 0.24);
    background: rgba(16, 185, 129, 0.08);
    font-size: 0.76rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.trust-note strong {
    color: var(--text);
}

/* Workspace Header */
.workspace-header {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.workspace-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
}

/* Inline Progress (inside workspace tree) */
.inline-progress {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 14px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
}
.ip-header {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 8px;
}
.ip-title {
    flex: 1; font-size: 0.8rem; font-weight: 500; color: var(--text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ip-pct {
    font-size: 0.78rem; font-weight: 600; color: var(--primary);
    font-variant-numeric: tabular-nums;
}
.ip-stats {
    display: flex; gap: 14px; margin-top: 6px;
    font-size: 0.72rem; color: var(--text-muted);
}
.ip-stat span { font-weight: 600; color: var(--text); }

.ip-pricing {
    margin-top: 8px;
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.45;
    background: rgba(79, 95, 212, 0.06);
    border: 1px solid rgba(79, 95, 212, 0.15);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
}

/* Detail row (blocks/images during migration) */
.ip-detail {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.72rem; color: var(--text-muted);
    margin-bottom: 0;
}
.ip-dot { opacity: 0.4; }

/* Failure list */
.failure-list {
    margin-top: 8px; padding-top: 8px;
    border-top: 1px solid var(--border);
    text-align: left;
}
.fl-items {
    list-style: none; padding: 0; margin: 0;
    max-height: 240px; overflow-y: auto;
}
.fl-item {
    padding: 8px 10px; border-bottom: 1px solid var(--border);
    font-size: 0.75rem; line-height: 1.5;
}
.fl-item:last-child { border-bottom: none; }
.fl-path {
    color: var(--text-muted); font-size: 0.7rem;
    word-break: break-all;
}
.fl-title {
    color: var(--text); font-weight: 600;
}
.fl-reason {
    color: var(--danger); font-size: 0.7rem;
    margin-top: 2px;
}

/* Node inline status badge */
.node-status {
    font-size: 0.75rem; margin-left: 6px; flex-shrink: 0;
    line-height: 1;
}
.tree-row .node-status { order: 10; }

/* Cards */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    position: relative;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-shadow: var(--shadow-sm);
}

.card:hover {
    border-color: var(--border-active);
    box-shadow: var(--shadow);
}

/* Dimmed (future/unavailable) card — not clickable */
.card-dimmed {
    opacity: 0.35;
    pointer-events: none;
    user-select: none;
}
.card-dimmed:hover {
    border-color: var(--border);
    box-shadow: var(--shadow-sm);
}

/* Completed card — clickable with completion badge */
.card-completed {
    opacity: 0.55;
    cursor: pointer;
    position: relative;
}
.card-completed:hover {
    opacity: 0.75;
    border-color: var(--border-active);
    box-shadow: var(--shadow);
}
.card-completed::after {
    content: '✅';
    position: absolute;
    top: 12px;
    right: 14px;
    font-size: 0.85rem;
}

.card .card-logo {
    width: 40px;
    height: 40px;
    position: absolute;
    top: 16px;
    right: 16px;
    opacity: 0.85;
}
.card .card-logo-png {
    width: 48px;
    height: 48px;
    top: 12px;
    right: 12px;
}

.card h2 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.card > p {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-bottom: 0;
}

/* ── 时间轴 (左侧三个步骤卡片串联) ── */
.left-panel .card {
    margin-left: 34px;
    position: relative;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: linear-gradient(135deg, var(--bg-surface) 0%, rgba(249, 250, 251, 0.8) 100%);
    box-shadow: 0 2px 12px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.05);
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.left-panel .card:hover {
    border-color: var(--border-active);
    box-shadow: 0 4px 20px rgba(0,0,0,0.06), 0 1px 4px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}
.left-panel .card.is-current {
    border-color: rgba(79, 95, 212, 0.5);
    background: linear-gradient(135deg, rgba(79, 95, 212, 0.08) 0%, rgba(79, 95, 212, 0.03) 100%);
    box-shadow: 0 8px 24px rgba(79, 95, 212, 0.12), 0 2px 8px rgba(0,0,0,0.05);
}
.left-panel .card:not(.card-dimmed):not(.card-completed):hover {
    border-color: var(--primary);
    box-shadow: 0 4px 20px rgba(79, 95, 212, 0.12), 0 1px 4px rgba(79, 95, 212, 0.08);
}

/* 已完成卡片保持气泡但降低饱和度 */
.left-panel .card-completed {
    opacity: 0.46;
}
.left-panel .card-completed:hover {
    opacity: 0.62;
}

/* dimmed 卡片：降低存在感 */
.left-panel .card-dimmed {
    opacity: 0.30;
}
.left-panel .card-dimmed:hover {
    border-color: var(--border);
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    transform: none;
}

/* 时间轴圆点 */
.left-panel .card::before {
    content: attr(data-step);
    position: absolute;
    left: -34px;
    top: 22px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--border);
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 10;
    transition: border-color 0.3s, background 0.3s, color 0.3s, box-shadow 0.3s;
}

/* 时间轴连接线 */
.left-panel .card:not(:last-of-type)::after {
    content: '';
    position: absolute;
    left: -23px;
    top: 45px;
    width: 2px;
    height: calc(100% - 10px);
    background: var(--border);
    z-index: 0;
    transition: background 0.3s;
}

/* 已完成步骤：绿色圆点 + 绿色线 */
.left-panel .card-completed::before {
    content: '✓';
    background: var(--success);
    border-color: var(--success);
    color: #fff;
    font-size: 0.65rem;
}
.left-panel .card-completed::after {
    background: var(--success);
}

/* 当前步骤：蓝色圆点 + 光晕 */
.left-panel .card:not(.card-dimmed):not(.card-completed)::before {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(79, 95, 212, 0.15);
}

/* Guide 中的子步骤高亮：当前步骤清晰，其他步骤弱化（克制） */
.workspace-guide .ph-step-main {
    opacity: 0.56;
    transition: opacity 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.workspace-guide .ph-step-main.is-active {
    opacity: 1;
    border-color: rgba(79, 95, 212, 0.42);
    background: linear-gradient(135deg, rgba(79, 95, 212, 0.08) 0%, rgba(79, 95, 212, 0.02) 100%);
    box-shadow: 0 6px 20px rgba(79, 95, 212, 0.10), var(--shadow-sm);
}

.workspace-guide.is-muted .ph-step-main {
    opacity: 0.42;
}

/* Config Grid */
.config-grid {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.config-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.config-label {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.config-status {
    font-size: 0.8rem;
}

.config-status.ok { color: var(--success); }
.config-status.missing { color: var(--danger); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 16px;
    height: 34px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.83rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-primary {
    background: var(--primary);
    color: var(--primary-text);
    border-color: var(--primary);
}

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

.btn-danger {
    background: transparent;
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: var(--danger-dim);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn:not(.btn-primary):not(.btn-danger) {
    background: var(--bg-surface);
    border-color: var(--border);
    color: var(--text-secondary);
}

.btn:not(.btn-primary):not(.btn-danger):hover {
    border-color: var(--border-active);
    color: var(--text);
}

#authArea {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
}

#btnStartAuth {
    flex-shrink: 0;
}

.inline-auth-code {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;
    flex-shrink: 0;
    min-width: 0;
    margin-left: 0;
    height: 34px;
    padding: 0 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    max-width: 100%;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.inline-auth-code.is-visible {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.inline-auth-code-label {
    font-size: 0.74rem;
    color: var(--text);
    font-weight: 700;
    flex-shrink: 0;
    padding-right: 5px;
    border-right: 1px solid var(--border);
    line-height: 1;
}

.inline-auth-code-value {
    font-family: var(--font-mono);
    font-size: 0.86rem;
    letter-spacing: 0.02em;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    background: transparent;
    border: none;
    padding: 0;
    min-width: 0;
    text-align: center;
}

.inline-copy-btn {
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.15s, background-color 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.inline-copy-btn:hover {
    color: var(--text);
    background: rgba(79, 95, 212, 0.12);
}

.inline-copy-hint {
    font-size: 0.72rem;
    color: var(--success);
    display: none;
    opacity: 0;
    transition: opacity 0.15s;
}

.inline-copy-hint:not(:empty) {
    display: inline;
    margin-left: 2px;
}

.inline-copy-hint.show {
    opacity: 1;
}

/* Auth Code Card */
.auth-code-card {
    background: linear-gradient(180deg, rgba(79, 95, 212, 0.1) 0%, rgba(79, 95, 212, 0.05) 100%);
    border: 1px solid rgba(79, 95, 212, 0.2);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: 0 4px 14px rgba(79, 95, 212, 0.08);
}
.acc-label {
    font-size: 0.78rem; font-weight: 600; color: var(--text);
    margin-bottom: 8px;
}

.inline-copy-btn-icon {
    width: 13px;
    height: 13px;
    opacity: 0.65;
}

.inline-copy-btn:hover .inline-copy-btn-icon {
    opacity: 0.9;
}
.acc-header {
    font-size: 0.82rem; color: var(--text-secondary);
    margin: 12px 0 2px; line-height: 1.6;
    text-align: left;
}
.acc-link {
    display: block; margin-top: 10px; margin-bottom: 2px;
    font-family: var(--font-mono); font-size: 0.73rem;
    color: var(--primary);
    word-break: break-all; text-decoration: none;
    text-align: left;
}
.acc-link:hover { text-decoration: underline; }
.acc-hint {
    margin: 12px 0 0; font-size: 0.73rem; color: var(--text-muted);
    text-align: left;
}

.auth-link-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 2px;
}

.auth-link-line {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 6px;
    font-size: 0.8rem;
    color: var(--text);
    margin-top: 8px;
    line-height: 1.5;
    padding: 7px 10px;
    border: 1px solid rgba(79, 95, 212, 0.18);
    border-radius: var(--radius-sm);
    background: rgba(79, 95, 212, 0.05);
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.auth-link-line:hover {
    border-color: rgba(79, 95, 212, 0.28);
    background: rgba(79, 95, 212, 0.07);
}

.auth-link-line .acc-link {
    display: inline;
    margin: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
    font-weight: 600;
}

.auth-link-line .acc-link:hover {
    text-decoration-thickness: 2px;
}

.auth-link-line .acc-link:focus-visible {
    outline: 2px solid rgba(79, 95, 212, 0.3);
    outline-offset: 2px;
    border-radius: 2px;
}

.auth-waiting {
    align-items: flex-start;
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.22);
    border-radius: var(--radius);
    padding: 12px 14px;
    gap: 10px;
}

.auth-waiting .auth-waiting-body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.auth-waiting .auth-waiting-body strong {
    color: var(--text);
    font-size: 0.86rem;
}

.auth-waiting .auth-waiting-body p {
    margin: 0;
    font-size: 0.79rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Device Code (standalone) */
.device-code-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin: 10px 0;
}
.device-code-box a {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--primary);
    word-break: break-all;
    display: block;
    margin-bottom: 8px;
}
.device-code {
    font-family: var(--font-mono);
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 0.25em;
    color: var(--text);
    text-align: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.dc-icon-wrap {
    position: relative; display: inline-flex; align-items: center;
    flex-shrink: 0;
}
.dc-icon {
    width: 16px; height: 16px; flex-shrink: 0;
    opacity: 0.3; transition: opacity 0.15s, transform 0.1s;
    cursor: pointer; user-select: none;
}
.device-code:hover .dc-icon { opacity: 0.6; }
.dc-icon:active { transform: scale(0.8); opacity: 0.5; }

/* Copy hint — absolute to right of icon, stays inside box */
.acc-copy-hint {
    position: absolute; left: calc(100% + 4px); top: 50%; transform: translateY(-50%);
    font-size: 0.65rem; color: var(--success); font-weight: 500;
    opacity: 0; transition: opacity 0.15s;
    pointer-events: none; white-space: nowrap;
}
.acc-copy-hint.show { opacity: 1; }

/* Inline copy icon (e.g., next to page name in guide text) */
.inline-copy-icon {
    width: 1em; height: 1em;
    margin-left: 3px;
    vertical-align: -0.1em;
    cursor: pointer;
    opacity: 0.45;
    transition: opacity 0.15s;
    color: var(--text-secondary);
}
.inline-copy-icon:hover { opacity: 0.8; }
.inline-copy-icon:active { transform: scale(0.85); }

/* Toast notification */
.toast {
    position: fixed; bottom: 32px; left: 50%; transform: translate(-50%, 12px);
    background: var(--text);
    color: #fff;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: var(--font);
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
    pointer-events: none;
    z-index: 9999;
}
.toast-visible { opacity: 1; transform: translate(-50%, 0); }

/* Success Badge */
.success-badge {
    background: var(--success-dim);
    color: var(--success);
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Step1/Step2 success tips: no background, more distance from cards */
#authSuccess,
#notionSuccess {
    margin-top: 16px;
    width: 100%;
    text-align: center;
}

#authSuccess .success-badge,
#notionSuccess .success-badge {
    background: transparent;
    padding: 0;
    border-radius: 0;
    font-size: 1.5rem;
    font-weight: 700;
}

/* Setup Guide */
.setup-guide {
    background: var(--primary-dim);
    border: 1px solid rgba(91, 111, 224, 0.15);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-top: 12px;
}

.setup-guide h4 {
    color: var(--primary);
    margin-bottom: 12px;
}

.setup-guide ol {
    padding-left: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 2;
}

.setup-guide a {
    color: var(--primary);
    text-decoration: none;
}

.setup-guide code {
    background: rgba(0,0,0,0.06);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.82em;
    font-family: var(--font-mono);
}

/* Notebook List */
.notebook-list {
    margin-bottom: 16px;
}

/* Tree styles */
.tree-list {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
}

.tree-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(0,0,0,0.03);
    transition: background 0.15s;
    cursor: default;
}

.tree-row:hover {
    background: rgba(0,0,0,0.03);
}

.tree-row:last-child {
    border-bottom: none;
}

.tree-toggle {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 4px;
    transition: all 0.15s;
}

.tree-toggle:hover {
    background: rgba(0,0,0,0.07);
    color: var(--text);
}

.tree-toggle-empty {
    cursor: default;
    visibility: hidden;
}

.tree-icon {
    flex-shrink: 0;
    font-size: 14px;
}

.tree-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 节点类型层级：notebook > sectionGroup > section > page */
.tree-row[data-node-type="notebook"] .tree-name {
    font-size: 0.95rem;
    font-weight: 600;
}
.tree-row[data-node-type="sectionGroup"] .tree-name {
    font-size: 0.88rem;
    font-weight: 500;
}
.tree-row[data-node-type="section"] .tree-name {
    font-size: 0.82rem;
    font-weight: 400;
}
.tree-row[data-node-type="page"] .tree-name {
    font-size: 0.78rem;
    font-weight: 400;
}

/* section 标题后的页面数 */
.tree-name .page-count {
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--primary);
}

.tree-name-muted {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.85rem;
}

.tree-type {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: rgba(0,0,0,0.05);
    padding: 2px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

.tree-children {
    border-left: 1px solid rgba(91, 111, 224, 0.2);
}

.tree-error {
    color: var(--danger);
    font-size: 0.85rem;
    padding: 8px 16px;
}

.tree-more {
    color: var(--primary);
    cursor: pointer;
    font-size: 0.85rem;
}

.tree-more:hover {
    background: rgba(91, 111, 224, 0.08);
}

.notebook-item {
    background: rgba(0,0,0,0.025);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 8px;
}

.notebook-item .nb-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 8px;
}

.nb-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

.select-all-row {
    padding: 8px 12px 6px;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.select-all-row label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.select-all-row input {
    accent-color: var(--primary);
}

.notebook-item .nb-icon {
    font-size: 1.2rem;
}

.notebook-item .nb-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-left: 28px;
}

.loading {
    color: var(--text-muted);
    text-align: center;
    padding: 20px;
}

/* Progress Area */
.progress-area {
    margin-top: 18px;
}

.progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

#progressCurrent {
    font-size: 0.82rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 10px;
}

.progress-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

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

/* 树节点加载中的旋转圆环 */
.tree-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
    vertical-align: middle;
}
.tree-toggle .tree-spinner {
    width: 12px;
    height: 12px;
    border-width: 2px;
}
.stat-spinner {
    margin-left: 5px;
    width: 10px;
    height: 10px;
    border-width: 2px;
    vertical-align: middle;
}

.progress-bar-container {
    background: var(--bg);
    border-radius: 100px;
    height: 4px;
    overflow: hidden;
    margin-bottom: 14px;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 100px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.stat {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
}

.stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Progress bar area (bar + pct + button) */
.ip-bar-area {
    margin-bottom: 8px;
}
.ip-bar-row {
    display: flex;
    align-items: center;
    gap: 0;
}
.progress-bar-wrap {
    flex: 1;
    position: relative;
    padding-right: 16px;
    margin-right: 16px;
}
.progress-bar-wrap::after {
    content: '';
    position: absolute;
    right: 0;
    top: -10px;
    bottom: -6px;
    width: 2px;
    background: var(--border-active);
    border-radius: 1px;
}
.progress-bar-wrap .ip-pct {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
    position: absolute;
    top: -18px;
    right: 16px;
}
.progress-bar-wrap .progress-bar-container {
    margin-top: 4px;
    margin-bottom: 0;
    background: var(--bg-elevated);
    height: 6px;
}
.ip-bar-row .btn {
    flex-shrink: 0;
    white-space: nowrap;
    height: 30px;
    font-size: 0.78rem;
    padding: 0 14px;
}

/* Log area */
.ip-log {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    max-height: 120px;
    overflow-y: auto;
}
.ip-log-content {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-secondary);
    line-height: 1.6;
}
.ip-log-content .log-line {
    padding: 1px 0;
}
.ip-log-content .log-line.log-warn {
    color: var(--warning);
}
.ip-log-content .log-line.log-error {
    color: var(--danger);
}

/* 已完成日志行 — 绿色 ✔︎ */
.ip-log-content .log-line.log-done {
    color: var(--success);
}
.ip-log-content .log-check {
    color: var(--success);
    margin-right: 2px;
}

/* 正在执行中的日志行 — 旋转 ⠴ */
.ip-log-content .log-line.log-running {
    color: var(--text-primary);
}
.ip-log-content .log-spinner {
    display: inline-block;
    animation: logSpin 0.8s steps(6, end) infinite;
    margin-right: 2px;
}
@keyframes logSpin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Notion Setup */
.notion-setup-step {
    margin-bottom: 10px;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.notion-setup-step strong {
    color: var(--text);
    font-weight: 600;
}

/* Account Info (个人中心 - 账号信息) */
.account-info {
    background: linear-gradient(135deg, var(--bg-surface) 0%, rgba(249, 250, 251, 0.9) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px 0;
    margin-bottom: 18px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.05);
}

.account-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    transition: background 0.15s;
}

.account-info-row:hover {
    background: rgba(79, 95, 212, 0.03);
}

.account-info-row:last-child {
    border-bottom: none;
}

.account-info-label {
    font-size: 0.84rem;
    color: var(--text-secondary);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-icon {
    font-size: 1rem;
    flex-shrink: 0;
    opacity: 0.7;
}

.ai-icon-img {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.85;
}

.account-info-value {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    text-align: right;
    word-break: break-all;
    max-width: 60%;
}

.account-actions {
    background: linear-gradient(135deg, rgba(79, 95, 212, 0.05) 0%, rgba(124, 58, 237, 0.03) 100%);
    border: 1px solid rgba(79, 95, 212, 0.12);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 22px;
    text-align: center;
}

.account-actions .btn {
    width: 100%;
    height: 40px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius);
    box-shadow: 0 2px 8px rgba(79, 95, 212, 0.2);
    transition: all 0.2s;
}

.account-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(79, 95, 212, 0.3);
}

.account-pricing {
    margin-top: 12px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.6;
    text-align: center;
    padding: 10px 14px;
    background: rgba(79, 95, 212, 0.06);
    border: 1px solid rgba(79, 95, 212, 0.1);
    border-radius: var(--radius-sm);
}

.workspace-account {
    min-height: 360px;
    max-width: 900px;
    margin: 0 auto;
}

.workspace-account .workspace-header {
    margin-bottom: 14px;
    padding-bottom: 12px;
}

.workspace-account .workspace-header h3 {
    font-size: 1rem;
}

/* Orders */
.account-orders {
    /* loading 状态不使用卡片样式 */
}

.order-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-surface);
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.05);
}

.order-row {
    display: grid;
    grid-template-columns: 1.2fr 0.7fr 0.7fr 0.7fr 0.8fr 1fr;
    gap: 6px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    font-size: 0.78rem;
    align-items: center;
    transition: background 0.15s;
}

.order-row:not(.head):hover {
    background: rgba(79, 95, 212, 0.03);
}

.order-row.head {
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: rgba(0,0,0,0.02);
}

.order-row:last-child {
    border-bottom: none;
}

.order-support-text {
    margin-top: 14px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.order-no {
    font-family: var(--font-mono);
    font-size: 0.73rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7rem;
    border: 1px solid var(--border);
}

.status-chip.success {
    color: var(--success);
    border-color: rgba(29, 168, 107, 0.35);
    background: rgba(29, 168, 107, 0.08);
}

.status-chip.pending {
    color: var(--warning);
    border-color: rgba(229, 138, 0, 0.35);
    background: rgba(229, 138, 0, 0.08);
}

.status-chip.failed,
.status-chip.expired {
    color: var(--danger);
    border-color: rgba(217, 48, 48, 0.35);
    background: rgba(217, 48, 48, 0.08);
}

.pay-modal {
    position: fixed;
    inset: 0;
    background: rgba(20, 24, 35, 0.45);
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.pay-modal-panel {
    width: min(520px, 100%);
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid #d8dde8;
    box-shadow: 0 20px 60px rgba(30, 37, 52, 0.25);
    padding: 16px;
}

.pay-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.pay-modal-head h3 {
    font-size: 1rem;
    font-weight: 700;
}

.pay-modal-close {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.pay-modal-desc {
    color: var(--text-secondary);
    font-size: 0.82rem;
    margin-bottom: 8px;
}

.pay-modal-quota {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 10px;
}

.pay-modal-needed {
    font-weight: 600;
}

.pay-modal-form label {
    display: block;
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.pay-modal-form input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    font-size: 0.88rem;
    margin-bottom: 6px;
}

.pay-amount-hint {
    font-size: 0.74rem;
    color: var(--text-muted);
}

.pay-amount-hint.is-error {
    color: var(--danger);
    font-weight: 600;
}

.pay-modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.pay-provider-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.pay-provider-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.pay-provider-logo {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.pay-modal-order {
    margin-top: 12px;
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.pay-order-line {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.pay-qr-actions {
    margin-top: 8px;
    display: flex;
    justify-content: center;
}

.pay-qr-actions .btn {
    height: 30px;
    padding: 0 12px;
    font-size: 0.76rem;
}

.pay-qr-wrap {
    margin-top: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px;
    position: relative;
    display: flex;
    justify-content: center;
    background: #fafcff;
}

.pay-qr-wrap img {
    width: 220px;
    height: 220px;
}

.pay-qr-guide {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.76rem;
    color: var(--text-secondary);
}

.pay-qr-guide-logo {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

.pay-qr-wrap.expired img {
    filter: grayscale(1);
    opacity: 0.45;
}

.pay-qr-wrap.success img {
    filter: grayscale(1);
    opacity: 0.5;
}

.pay-qr-wrap.expired::after {
    content: '已失效';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(20, 24, 35, 0.78);
    color: #fff;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.pay-qr-success-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.pay-qr-success-check {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #1da86b;
    border: 2px solid #ffffff;
    box-shadow: 0 8px 20px rgba(29, 168, 107, 0.35);
    color: #ffffff;
    font-size: 1.9rem;
    line-height: 48px;
    font-weight: 700;
    text-align: center;
}

.pay-qr-success-title {
    margin-top: 8px;
    color: #1b7f52;
    font-size: 0.84rem;
    font-weight: 700;
}

.pay-qr-success-sub {
    margin-top: 2px;
    color: #1b7f52;
    font-size: 0.76rem;
    font-weight: 600;
}

.pay-qr-wrap.success .pay-qr-success-overlay {
    display: flex !important;
}

.pay-order-status {
    margin-top: 8px;
    font-size: 0.78rem;
    color: var(--warning);
}

.pay-order-status.success {
    color: var(--success);
    font-weight: 600;
}

.pay-order-status.failed {
    color: var(--danger);
}

.pay-order-support {
    margin-top: 4px;
    font-size: 0.74rem;
    color: var(--text-muted);
}

.inline-link {
    color: var(--primary);
    text-decoration: none;
}
.inline-link:hover { text-decoration: underline; }

.setup-input {
    display: block;
    width: 100%;
    padding: 7px 10px;
    margin-top: 4px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    transition: border-color 0.15s;
}

.setup-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* Footer */
.footer {
    text-align: center;
    padding: 24px 0;
    color: var(--text-muted);
    font-size: 0.75rem;
    border-top: 1px solid var(--border);
    margin-top: 32px;
    flex-shrink: 0;
}

/* Responsive */
@media (max-width: 900px) {
    .header {
        flex-wrap: wrap;
        gap: 8px;
        padding: 10px 0 8px;
    }
    .header-right {
        width: 100%;
        justify-content: space-between;
        gap: 8px;
    }
    .header-nav {
        order: 3;
        width: 100%;
    }
    .main { flex-direction: column; }
    .left-panel {
        width: 100%;
        border-right: none;
        padding: 14px 0 10px;
        gap: 10px;
    }
    .left-panel .card {
        margin-left: 0;
        border-radius: 14px;
    }
    .left-panel .card::before,
    .left-panel .card::after {
        display: none;
    }
    .right-panel { padding-left: 0; min-height: 300px; }

    .workspace-guide {
        min-height: auto;
        align-items: stretch;
        text-align: left;
    }
    .placeholder-steps {
        margin-top: 8px;
        gap: 12px;
    }
    .ph-step-main {
        padding: 14px;
    }
    .ph-step-body {
        padding-left: 30px;
    }
    .ph-step-body .btn {
        width: 100%;
        margin-top: 6px;
    }
    .auth-link-line {
        display: block;
    }

    .order-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .pay-modal-actions {
        flex-direction: column;
    }
}
@media (max-width: 640px) {
    .app { padding: 0 12px; }
    .hero { margin: 0 -12px; }
    .hero-content { padding: 16px 12px; }
    .hero-illustration { width: 52px; height: 52px; }
    .header-nav-item { padding: 5px 10px; font-size: 0.76rem; }
    .card { padding: 14px; }
    .progress-stats { grid-template-columns: repeat(2, 1fr); }
    .device-code { font-size: 1.4rem; letter-spacing: 0.1em; }
    .workspace-account { max-width: 100%; }
    .account-info-row { padding: 10px 14px; }
    .account-info-value { font-size: 0.82rem; max-width: 55%; }
    .user-menu { width: min(92vw, 260px); }
    .pay-modal-panel {
        width: min(94vw, 520px);
        max-height: 88vh;
        overflow-y: auto;
    }
    #authArea {
        align-items: stretch;
        overflow-x: visible;
        flex-wrap: wrap;
    }
    .inline-auth-code {
        width: 100%;
        justify-content: space-between;
        height: auto;
        padding: 8px 10px;
    }
}
