/* public/assets/css/dark-theme.css */
/* 深色主题 - 专业机械设计工具风格 */

:root {
    /* 主色调 - 青绿色 */
    --primary-color: #00d4aa;
    --primary-dark: #00b894;
    --primary-light: #00e6bc;
    
    /* 背景色 - 深色渐变 */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    
    /* 文字颜色 */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* 边框和分隔线 */
    --border-color: #334155;
    --divider-color: #475569;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.6);
    
    /* 状态色 */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    
    /* 圆角 */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 确保所有页面使用深色背景 */
body {
    background: var(--bg-primary) !important;
}

/* 应用容器 - 深色主题 */
.app-container {
    background: var(--bg-primary);
}

/* 头部导航 - 深色主题 */
.header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: 56px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-title {
    font-size: 22px;
    font-weight: 600;
    flex: 1;
    text-align: center;
    color: #00d4aa;
}

.header-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    border-radius: 50%;
    transition: background 0.3s;
}

.header-btn:active {
    background: rgba(255,255,255,0.1);
}

/* 主内容区 - 深色主题 */
.main-content {
    padding-top: 66px;
    padding-bottom: 60px;
    min-height: 100vh;
    background: var(--bg-primary);
}

/* 底部导航 - 深色主题 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: 50px;
    background: var(--bg-card);
    display: flex;
    border-top: 1px solid var(--border-color);
    z-index: 1000;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.2;
    transition: color 0.2s;
    gap: 1px;
}

.nav-item.active {
    color: #10b981;
}

.nav-item.active .nav-icon {
    color: #10b981;
}

.nav-item.active span {
    color: #10b981;
}

.nav-icon {
    font-size: 20px;
    margin-bottom: 0;
    color: inherit;
    transition: color 0.2s;
    line-height: 1;
}

.nav-item span {
    color: inherit;
    transition: color 0.2s;
    line-height: 1;
    margin-top: 0;
}

/* 卡片样式 - 深色主题 */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin: 15px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

/* 工具列表项 - 深色主题 */
.tool-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s, transform 0.2s, background-color 0.2s;
    position: relative;
    overflow: visible;
}

.tool-item:hover {
    border-color: rgba(0, 212, 170, 0.3);
}

.tool-item.selected {
    position: relative;
    border-color: rgba(0, 212, 170, 0.3);
    box-shadow: 0 0 0 2px rgba(0, 212, 170, 0.1);
    overflow: visible;
}

.tool-item.selected::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -1px;
    right: -1px;
    height: 4px;
    background: linear-gradient(90deg, 
        rgba(0, 212, 170, 0) 0%, 
        rgba(0, 212, 170, 1) 50%, 
        rgba(0, 212, 170, 0) 100%);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    z-index: 10;
    pointer-events: none;
}

.tool-item:active {
    transform: scale(0.98);
    background: var(--bg-hover);
}

.tool-icon {
    width: 50px;
    height: 50px;
    background: rgba(0, 212, 170, 0.1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00d4aa;
    font-size: 24px;
    margin-right: 15px;
    flex-shrink: 0;
}

.tool-info {
    flex: 1;
}

.tool-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.tool-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Toast提示 - 深色主题 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    z-index: 10000;
    display: none;
    font-size: 14px;
}

.toast.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* 加载覆盖层 - 深色主题 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 模态框 - 深色主题 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: 0;
    max-width: 450px;
    width: calc(100% - 30px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #f1f5f9;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #94a3b8;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, color 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #f1f5f9;
}

/* 更换邮箱模态窗口 */
.update-email-modal {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    max-width: 450px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.update-email-modal .modal-header {
    position: sticky;
    top: 0;
    background: #1e293b;
    z-index: 10;
    border-radius: 16px 16px 0 0;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.update-email-modal .modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #f1f5f9;
}

.update-email-modal .modal-body {
    padding: 20px;
}

/* PC拦截提示 - 深色主题 */
.pc-block {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 40px;
    text-align: center;
}

.pc-block-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.pc-block-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.pc-block-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 横屏提示 - 深色主题 */
.landscape-tip {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.landscape-tip-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.landscape-tip p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* 认证页面背景 */
.auth-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    position: relative;
}

.auth-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(99, 102, 241, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

/* Logo 区域 */
.auth-header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.auth-logo {
    width: 88px;
    height: 88px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(0, 212, 170, 0.4);
    transition: transform 0.3s ease;
}

.auth-logo:hover {
    transform: translateY(-4px);
}

.auth-logo svg {
    width: 44px;
    height: 44px;
    stroke: white;
}

.auth-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* 表单卡片 */
.auth-form {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px 28px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-xl);
    position: relative;
    z-index: 1;
}

.form-group {
    margin-bottom: 22px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    height: 48px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0 16px;
    font-size: 15px;
    color: var(--text-primary);
    transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}

/* 修复浏览器自动填充背景色 */
.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus,
.form-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--bg-secondary) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    background-color: var(--bg-secondary) !important;
    transition: background-color 5000s ease-in-out 0s;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.15);
}

.form-input:hover {
    border-color: var(--divider-color);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
    text-decoration: none;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #0a0a0f;
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 170, 0.45);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-block {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* 链接样式 */
.auth-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.auth-link {
    color: var(--primary-light);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}

.auth-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* 步骤指示器 */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
    gap: 12px;
}

.step {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    transition: background-color 0.3s, border-color 0.3s, color 0.3s, box-shadow 0.3s;
}

.step.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.step.completed {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.step-line {
    width: 50px;
    height: 2px;
    background: var(--border-color);
    transition: background 0.3s;
}

.step-line.completed {
    background: var(--success);
}

/* 成功状态 */
.success-step {
    text-align: center;
    padding: 40px 20px;
}

.success-icon {
    font-size: 72px;
    margin-bottom: 24px;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.success-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.success-desc {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.6;
}

/* 提示文字 */
.form-tips {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.5;
}

.form-tips.error {
    color: var(--error);
}

.form-tips.success {
    color: var(--success);
}

/* 输入框组 */
.form-input-group {
    display: flex;
    gap: 10px;
}

.form-input-group .form-input {
    flex: 1;
}

.btn-code {
    height: 48px;
    padding: 0 20px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    color: var(--primary-color);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.btn-code:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-code:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 移动端优化 */
@media (max-width: 480px) {
    .auth-form {
        padding: 28px 22px;
    }
    
    .auth-title {
        font-size: 24px;
    }
    
    .auth-logo {
        width: 76px;
        height: 76px;
    }
    
    .auth-logo svg {
        width: 38px;
        height: 38px;
    }
}

/* ========== 浏览器自动填充下拉列表深色样式 ========== */
/* Chrome/Safari/Edge 自动填充建议列表 */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
select:-webkit-autofill,
select:-webkit-autofill:hover,
select:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px #1e293b inset !important;
    box-shadow: 0 0 0px 1000px #1e293b inset !important;
    -webkit-text-fill-color: #ffffff !important;
    caret-color: #ffffff !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* 自动填充时的 placeholder 颜色 */
input:-webkit-autofill::placeholder,
textarea:-webkit-autofill::placeholder {
    color: #64748b !important;
    -webkit-text-fill-color: #64748b !important;
}

/* 禁用浏览器默认外观，防止白色下拉列表 */
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}
