/* ========================================
   全新 UI 设计系统 - 浅色主题
   ======================================== */

:root {
    --bg: #F8FAFB;
    --bg-card: #FFFFFF;
    --bg-sidebar: #0F172A;
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-tertiary: #94A3B8;
    --accent: #3B82F6;
    --accent-light: #60A5FA;
    --accent-bg: #EFF6FF;
    --success: #22C55E;
    --warning: #F59E0B;
    --danger: #EF4444;
    --error: #EF4444;
    --error-bg: #FEF2F2;
    --border: #E2E8F0;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
    --sidebar-width: 260px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { border: none; background: none; cursor: pointer; font-family: inherit; }

/* ========== 通用组件 ========== */

/* 按钮 */
.btn {
    height: 50px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

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

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

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    background: var(--text-tertiary);
    cursor: not-allowed;
}

.btn-block {
    width: 100%;
}

.btn-loading {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* 表单 */
.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.field-input {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.field-input:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(13,148,136,0.1);
}

.field-input.error {
    border-color: var(--error);
}

.field-icon {
    position: absolute;
    left: 14px;
    color: var(--text-tertiary);
    font-size: 20px;
    pointer-events: none;
}

.field-input .input {
    flex: 1;
    height: 50px;
    padding: 0 14px 0 46px;
    border: none;
    background: none;
    font-size: 15px;
    color: var(--text-primary);
    outline: none;
}

.field-input .input::placeholder {
    color: var(--text-tertiary);
}

.field-action {
    padding: 0 14px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
}

.field-action:hover {
    color: var(--text-secondary);
}

.field-error {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--error);
}

.field-error .material-symbols-rounded {
    font-size: 16px;
}

/* 复选框 */
.checkbox-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-input {
    display: none;
}

.checkbox-box {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.checkbox-box .material-symbols-rounded {
    font-size: 14px;
    color: #fff;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s;
}

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

.checkbox-input:checked + .checkbox-box .material-symbols-rounded {
    opacity: 1;
    transform: scale(1);
}

.checkbox-text {
    font-size: 14px;
    color: var(--text-secondary);
}

/* 提示框 */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    font-size: 14px;
}

.alert-error {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid #FECACA;
}

/* Toast */
.toast-container {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: var(--text-primary);
    color: #fff;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: toastIn 0.3s ease;
}

.toast-success { background: var(--success); }
.toast-error { background: var(--error); }

.toast-hide {
    animation: toastOut 0.3s ease forwards;
}

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

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

/* 导航栏 */
.navbar {
    position: sticky;
    top: 0;
    height: 56px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    z-index: 100;
}

.navbar-back {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
}

.navbar-back:hover {
    background: var(--bg);
}

.navbar-title {
    flex: 1;
    text-align: center;
    font-size: 17px;
    font-weight: 600;
    margin-right: 40px;
}


/* ========== 顶部导航栏 ========== */
.nav-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    width: 100%;
}

@media (min-width: 768px) {
    .nav-header {
        padding: 0 32px;
    }
}

.nav-back {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #F1F5F9;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.nav-back:hover {
    background: #E2E8F0;
}

.nav-back svg {
    width: 20px;
    height: 20px;
    color: #334155;
}

.nav-title {
    flex: 1;
    text-align: center;
    font-size: 17px;
    font-weight: 600;
    color: #0F172A;
    white-space: nowrap;
}

.nav-right {
    width: 36px;
    flex-shrink: 0;
}

/* ========== 主内容区域 ========== */
.main-content {
    min-height: calc(100vh - 56px - 70px);
    padding-bottom: 70px;
}

/* ========== 底部导航栏 ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: #fff;
    border-top: 1px solid #F1F5F9;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 100;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 16px;
    color: #94A3B8;
    text-decoration: none;
    transition: all 0.2s;
}

.bottom-nav-item svg {
    width: 24px;
    height: 24px;
}

.bottom-nav-item span {
    font-size: 11px;
    font-weight: 500;
}

.bottom-nav-item.active {
    color: var(--accent, #0D9488);
}

.bottom-nav-item.active svg {
    stroke: var(--accent, #0D9488);
}

/* PC端底部导航适配 */
@media (min-width: 768px) {
    .bottom-nav {
        padding: 0 32px;
    }
    .bottom-nav-item {
        padding: 8px 32px;
    }
}
