/* ============================================================
   WorkBuddy 积分服务 - 登录页样式
   参考 UI 设计稿：白色卡片 + 圆角 + 柔和阴影 + 青绿色主色
   ============================================================ */

:root {
    --primary:       #5cb39f;
    --primary-dark:  #3a8e7b;
    --primary-light: #e8f6f2;
    --text:          #333333;
    --text-secondary:#666666;
    --text-muted:    #999999;
    --border:        #e8e8e8;
    --border-focus:  #5cb39f;
    --bg:            #f5f6f8;
    --card-bg:       #ffffff;
    --shadow:        0 10px 40px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
    --radius-lg:     16px;
    --radius-md:     10px;
    --radius-sm:     6px;
}

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

html, body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
                 "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   登录页面
   ============================================================ */
.login-body {
    min-height: 100vh;
    background: var(--bg);
    background-image:
        radial-gradient(ellipse at top, #e8f6f2 0%, transparent 50%),
        radial-gradient(ellipse at bottom, #f0f4f8 0%, transparent 50%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 40px 36px;
}

/* --- Brand --- */
.brand { text-align: center; margin-bottom: 28px; }
.brand .logo { margin-bottom: 14px; }
.brand .logo svg { border-radius: 50%; box-shadow: 0 4px 12px rgba(92,179,159,0.3); }

.brand-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.brand-sub {
    font-size: 13px;
    color: var(--text-muted);
}

/* --- Tabs --- */
.tabs {
    display: flex;
    background: var(--bg);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 24px;
}

.tab {
    flex: 1;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all .2s ease;
}

.tab:hover { color: var(--text); }

.tab.active {
    background: var(--card-bg);
    color: var(--primary);
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

/* --- 表单面板 --- */
.tab-panel { display: none; animation: fadeIn .25s ease; }
.tab-panel.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.form-group { margin-bottom: 16px; }

.form-input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    font-size: 15px;
    color: var(--text);
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}

.form-input::placeholder { color: var(--text-muted); }

.form-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(92,179,159,0.15);
}

.form-input:disabled { background: var(--bg); color: var(--text-muted); }

/* 验证码行 */
.code-group { display: flex; gap: 10px; }
.code-group .form-input { flex: 1; }

.btn-sms {
    height: 46px;
    padding: 0 18px;
    font-size: 14px;
    color: var(--primary);
    background: var(--primary-light);
    border: 1.5px solid var(--primary);
    border-radius: var(--radius-md);
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
}

.btn-sms:hover:not(:disabled) {
    background: var(--primary);
    color: #fff;
}

.btn-sms:disabled {
    color: var(--text-muted);
    background: var(--bg);
    border-color: var(--border);
    cursor: not-allowed;
}

/* 表单提示文字 */
.form-tip {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 12px;
}

/* 同意条款 */
.checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    cursor: pointer;
    user-select: none;
}

.checkbox input { display: none; }

.checkmark {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border);
    border-radius: 4px;
    margin-top: 1px;
    transition: all .15s;
    position: relative;
}

.checkbox input:checked + .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox input:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 5px; top: 1px;
    width: 5px; height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

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

/* 主按钮 */
.btn-primary {
    width: 100%;
    height: 48px;
    font-size: 15px;
    font-weight: 500;
    color: #fff;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all .15s;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    box-shadow: 0 4px 14px rgba(92,179,159,0.35);
}

.btn-primary:active:not(:disabled) { transform: translateY(1px); }

.btn-primary:disabled {
    background: #c5d9d4;
    cursor: not-allowed;
}

/* Toast 提示 */
.toast {
    margin-top: 16px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
    animation: toastIn .25s ease;
}

.toast.hidden { display: none; }

.toast.error {
    background: #fff1f0;
    border: 1px solid #ffccc7;
    color: #cf1322;
}

.toast.success {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #389e0d;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Dashboard 布局（严格参照设计图：左侧固定边栏 + 右侧主区）
   ============================================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
    background: #f6f7f9;
}

/* --- 左侧边栏 --- */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 216px;
    background: #fff;
    border-right: 1px solid #eef0f3;
    display: flex;
    flex-direction: column;
    padding: 18px 14px;
    overflow-y: auto;
    z-index: 10;
}

.sb-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 4px 14px;
}
.sb-logo { flex-shrink: 0; }
.sb-title { font-size: 14px; font-weight: 700; color: var(--text); }

/* 积分余额卡片 */
.sb-balance {
    background: #e9faf1;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 14px;
}
.sb-balance-label { display: block; font-size: 12px; color: #8aa39a; margin-bottom: 4px; }
.sb-balance-num   { display: block; font-size: 24px; font-weight: 700; color: #10b981; line-height: 1.2; }
.sb-balance-raw   { display: block; font-size: 11px; color: #a3b8b0; margin-top: 2px; }

/* 菜单 */
.sb-menu { display: flex; flex-direction: column; gap: 2px; }

.sb-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    font-size: 13.5px;
    color: #5b6672;
    border-radius: 8px;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.sb-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.sb-item:hover { background: #f3f5f7; color: var(--text); }
.sb-item.active { background: #e9faf1; color: #10b981; font-weight: 600; }

.sb-invite-text { line-height: 1.3; }
.sb-invite-text em {
    display: block;
    font-style: normal;
    font-size: 11px;
    color: #f59e0b;
    margin-top: 1px;
}

/* 底部：二维码 + 退出 */
.sb-bottom { margin-top: auto; text-align: center; padding-top: 14px; }
.sb-qrcode svg { border: 1px solid #eef0f3; border-radius: 8px; }
.sb-qrcode-label { display: block; font-size: 12px; color: #8a94a0; margin-top: 6px; }

.sb-logout-form { margin-top: 14px; }
.sb-logout {
    background: none;
    border: none;
    padding: 6px 10px;
    font-size: 13px;
    color: #98a2ad;
    cursor: pointer;
}
.sb-logout:hover { color: #cf1322; }

/* --- 主内容区 --- */
.main {
    margin-left: 216px;
    flex: 1;
    padding: 18px 22px 30px;
    min-width: 0;
}

/* 公告条 */
.notice-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: 13px;
    border-radius: 10px;
    padding: 11px 16px;
    margin-bottom: 16px;
}
.notice-bar svg { width: 15px; height: 15px; flex-shrink: 0; }
.notice-bar a { color: #10b981; font-weight: 600; text-decoration: none; }
.notice-bar a:hover { text-decoration: underline; }

/* --- 教程卡片 --- */
.tutorial-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(16,24,40,.06);
    padding: 24px 26px;
}

.tc-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}

.tc-sub-row {
    display: flex;
    gap: 24px;
    font-size: 12.5px;
    color: #98a2ad;
    margin-bottom: 16px;
}
.tc-sub-row b { color: #5b6672; font-weight: 600; }

/* 按钮行 */
.tc-btn-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.btn-green {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #10b981;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 9px 18px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}
.btn-green svg { width: 14px; height: 14px; }
.btn-green:hover { background: #059669; }

.tc-btn-group { display: inline-flex; gap: 8px; flex-wrap: wrap; }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    color: #5b6672;
    border: 1px solid #e4e7ec;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
    transition: all .15s;
}
.btn-ghost svg { width: 13px; height: 13px; }
.btn-ghost:hover { border-color: #10b981; color: #10b981; }

/* 步骤 */
.tc-steps { display: flex; flex-direction: column; gap: 18px; }

.step { border-top: 1px solid #f2f4f6; padding-top: 16px; }
.step:first-child { border-top: none; padding-top: 0; }

.step-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.step-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #10b981;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-head b { font-size: 14.5px; color: var(--text); }

.step-desc {
    font-size: 13px;
    color: #7a8694;
    line-height: 1.8;
    margin: 0 0 10px 30px;
}

/* 步骤1：复制按钮 + 虚线箭头 + 提示词框 */
.step1-body {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: 30px;
}

.btn-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #10b981;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 13px 20px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
}
.btn-copy svg { width: 14px; height: 14px; }
.btn-copy:hover { background: #059669; }

.arrow-dash {
    width: 90px;
    height: 2px;
    border-top: 2px dashed #d5dbe2;
    position: relative;
    flex-shrink: 0;
}
.arrow-dash::after {
    content: '';
    position: absolute;
    right: -1px;
    top: -5px;
    border: 6px solid transparent;
    border-left: 8px solid #d5dbe2;
}

.prompt-box {
    flex: 1;
    background: #f8f9fb;
    border: 1px solid #eef0f3;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 12px;
    color: #7a8694;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
    max-height: 150px;
    overflow: auto;
    font-family: inherit;
}

.prompt-size {
    font-size: 11px;
    color: #b0b9c3;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 步骤3：模型列表演示（复刻设计图截图示意） */
.mock-area {
    margin: 14px 0 4px 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    background: #fafbfc;
    border: 1px solid #f0f2f5;
    border-radius: 12px;
    padding: 22px 18px;
}

.mock-note-left {
    font-size: 12.5px;
    color: #e5484d;
    line-height: 1.7;
    text-align: right;
}
.mock-note-left b { font-weight: 700; }
.mock-arrow { display: inline-block; margin-left: 4px; color: #e5484d; }

.mock-dropdown {
    width: 300px;
    background: #fff;
    border: 2px solid #e5484d;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(16,24,40,.10);
}

.mock-dd-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    font-size: 12px;
    color: #5b6672;
    background: #f8f9fb;
    border-bottom: 1px solid #f0f2f5;
}
.mock-dd-badge { font-size: 11px; color: #b0b9c3; }

.mock-dd-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 12.5px;
    color: #5b6672;
}
.mock-dd-item b { font-weight: 600; color: #333; }
.mock-dd-item.active { background: #e9faf1; color: #10b981; }
.mock-dd-item.active b { color: #10b981; }
.mock-check { margin-left: auto; color: #10b981; font-weight: 700; }
.mock-dd-item.custom { border-top: 1px solid #f0f2f5; color: #8a94a0; }

.mock-note-bottom {
    font-size: 12.5px;
    color: #e5484d;
    font-weight: 600;
    align-self: flex-end;
}

/* 收起条 */
.collapse-bar {
    display: block;
    width: 100%;
    margin-top: 20px;
    background: #f5f6f8;
    border: none;
    border-radius: 8px;
    padding: 10px;
    font-size: 13px;
    color: #7a8694;
    cursor: pointer;
    transition: background .15s;
}
.collapse-bar:hover { background: #eef0f3; color: var(--text); }

/* 页脚 */
.dash-footer {
    text-align: center;
    font-size: 12px;
    color: #b0b9c3;
    padding: 22px 0 6px;
}

/* 固定顶部 Toast */
.toast-fixed {
    position: fixed;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 999;
    min-width: 200px;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
}

/* ============================================================
   移动端适配
   ============================================================ */
@media (max-width: 480px) {
    .login-card {
        padding: 32px 24px;
        border-radius: 14px;
    }

    .brand-title { font-size: 18px; }
    .btn-primary { height: 46px; font-size: 14px; }
    .form-input { height: 44px; font-size: 15px; }  /* 防止 iOS 自动缩放 */
    .btn-sms { padding: 0 12px; font-size: 13px; height: 44px; }
}

/* 移动端顶部栏 / 抽屉遮罩（桌面端不显示） */
.m-topbar { display: none; }
.sb-mask { display: none; }

/* Dashboard 移动端：顶部栏 + 左侧抽屉菜单（参照手机端设计图） */
@media (max-width: 860px) {
    .app-layout { flex-direction: column; }

    /* --- 顶部栏 --- */
    .m-topbar {
        display: flex;
        align-items: center;
        gap: 8px;
        position: fixed;
        top: 0; left: 0; right: 0;
        height: 52px;
        background: #fff;
        border-bottom: 1px solid #eef0f3;
        padding: 0 14px;
        z-index: 40;
    }
    .m-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        margin-left: -6px;
        background: none;
        border: none;
        color: #374151;
        cursor: pointer;
        padding: 0;
    }
    .m-menu-btn svg { width: 20px; height: 20px; }
    .m-logo { flex-shrink: 0; }
    .m-title {
        font-size: 14.5px;
        font-weight: 700;
        color: var(--text);
        margin-right: auto;
        white-space: nowrap;
    }
    .m-logout {
        background: #e9faf1;
        color: #10b981;
        border: none;
        border-radius: 15px;
        padding: 6px 16px;
        font-size: 13px;
        cursor: pointer;
        transition: background .15s;
    }
    .m-logout:active { background: #d5f3e6; }

    /* --- 侧边栏 → 左滑抽屉 --- */
    .sidebar {
        width: 264px;
        max-width: 80vw;
        transform: translateX(-105%);
        transition: transform .25s ease;
        box-shadow: 4px 0 24px rgba(0,0,0,.08);
        z-index: 60;
    }
    .sidebar.open { transform: translateX(0); }

    /* --- 遮罩 --- */
    .sb-mask {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(17,24,39,.45);
        opacity: 0;
        visibility: hidden;
        transition: opacity .25s ease;
        z-index: 50;
    }
    .sb-mask.show { opacity: 1; visibility: visible; }

    /* --- 主内容区：避开固定顶栏 --- */
    .main { margin-left: 0; padding: 66px 14px 24px; }

    .tutorial-card { padding: 18px 16px; }
    .tc-sub-row { flex-direction: column; gap: 4px; }
    .step-desc { margin-left: 0; }
    .step1-body { flex-direction: column; align-items: stretch; margin-left: 0; }
    .arrow-dash, .prompt-size { display: none; }
    .prompt-box { max-height: none; }
    .mock-area { margin-left: 0; }
    .mock-note-left { text-align: center; }
}
