/**
 * 现代化借贷平台样式
 * 扁平化设计 + 卡片式布局 + 移动端优先
 */

:root {
    /* 浅色主题 */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f7fa;
    --bg-card: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --primary-color: #1890ff;
    --success-color: #52c41a;
    --warning-color: #faad14;
    --error-color: #f5222d;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] {
    /* 深色主题 */
    --bg-primary: #141414;
    --bg-secondary: #1f1f1f;
    --bg-card: #262626;
    --text-primary: #ffffff;
    --text-secondary: #bfbfbf;
    --border-color: #434343;
    --primary-color: #1890ff;
    --success-color: #52c41a;
    --warning-color: #faad14;
    --error-color: #f5222d;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 卡片样式 */
.card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: box-shadow 0.3s;
}

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

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 16px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: #40a9ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.3);
}

.btn-success {
    background: var(--success-color);
    color: #ffffff;
}

.btn-success:hover {
    background: #73d13d;
}

.btn-warning {
    background: var(--warning-color);
    color: #ffffff;
}

.btn-danger {
    background: var(--error-color);
    color: #ffffff;
}

.btn-block {
    width: 100%;
    display: block;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 验证码区域 */
.captcha-group {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.captcha-group .form-input {
    flex: 1;
}

.captcha-img {
    cursor: pointer;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    height: 48px;
    width: 120px;
    object-fit: contain;
    background: var(--bg-primary);
}

/* 步骤条 */
.steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 32px;
    position: relative;
}

.steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--border-color);
    z-index: 0;
}

.step {
    position: relative;
    z-index: 1;
    text-align: center;
    flex: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-weight: 600;
    transition: all 0.3s;
}

.step.active .step-number {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
}

.step.completed .step-number {
    background: var(--success-color);
    border-color: var(--success-color);
    color: #ffffff;
}

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

.step.active .step-title {
    color: var(--primary-color);
    font-weight: 500;
}

/* 状态标签 */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-pending {
    background: #fff7e6;
    color: #d48806;
}

.status-approved {
    background: #f6ffed;
    color: #52c41a;
}

.status-rejected {
    background: #fff1f0;
    color: #f5222d;
}

/* 视频录制区域 */
.video-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 20px;
}

.video-preview {
    width: 100%;
    border-radius: 8px;
    background: #000;
}

.video-text {
    background: var(--bg-card);
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
    border-left: 4px solid var(--primary-color);
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-primary);
}

/* 提示信息 */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-info {
    background: #e6f7ff;
    border-left: 4px solid var(--primary-color);
    color: #0050b3;
}

.alert-warning {
    background: #fffbe6;
    border-left: 4px solid var(--warning-color);
    color: #ad6800;
}

.alert-success {
    background: #f6ffed;
    border-left: 4px solid var(--success-color);
    color: #389e0d;
}

.alert-error {
    background: #fff1f0;
    border-left: 4px solid var(--error-color);
    color: #cf1322;
}

/* 导航栏 */
.navbar {
    background: var(--bg-card);
    padding: 16px 0;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.navbar-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
}

.navbar-menu {
    display: flex;
    gap: 20px;
    align-items: center;
}

.navbar-link {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s;
}

.navbar-link:hover {
    color: var(--primary-color);
}

.navbar-link.active {
    color: var(--primary-color);
    font-weight: 600;
}

/* 底部导航栏 - 默认隐藏（桌面端） */
.bottom-navbar {
    display: none;
}

/* 下拉菜单 */
.navbar-dropdown {
    position: relative;
    display: inline-block;
}

.navbar-dropdown-toggle {
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 0;
}

.navbar-dropdown-toggle:hover {
    color: var(--primary-color);
}

.navbar-dropdown-toggle.active {
    color: var(--primary-color);
    font-weight: 600;
}

.navbar-dropdown-toggle span {
    font-size: 10px;
    transition: transform 0.3s;
}

.navbar-dropdown:hover .navbar-dropdown-toggle span {
    transform: rotate(180deg);
}

.navbar-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: var(--shadow-hover);
    min-width: 180px;
    padding: 8px 0;
    margin-top: 4px;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 1000;
}

.navbar-dropdown:hover .navbar-dropdown-menu,
.navbar-dropdown.active .navbar-dropdown-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.navbar-dropdown-item {
    display: block;
    padding: 10px 20px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s;
    font-size: 14px;
    white-space: nowrap;
}

.navbar-dropdown-item:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

.navbar-dropdown-item.active {
    background: var(--bg-secondary);
    color: var(--primary-color);
    font-weight: 600;
}

/* 表格 */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
}

.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
}

.table tr:hover {
    background: var(--bg-secondary);
}

/* 主题切换 */
.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 14px;
}

/* 响应式 - 移动端统一样式 */
@media (max-width: 768px) {
    .container {
        padding: 12px;
        padding-bottom: 80px !important; /* 为底部导航栏留出空间 */
        margin-bottom: 0;
    }
    
    .card {
        padding: 16px;
        margin-bottom: 16px;
        border-radius: 12px;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    }
    
    .card-title {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    /* 账号卡片样式 */
    .account-card {
        padding: 16px;
        position: relative;
        padding-bottom: 60px;
    }
    
    .account-card img {
        width: 70px !important;
        height: 70px !important;
    }
    
    /* 退出按钮（移动端） */
    .logout-btn-mobile {
        position: absolute;
        bottom: 16px;
        right: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 8px 16px;
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
        border-radius: 20px;
        text-decoration: none;
        color: var(--text-secondary);
        transition: all 0.3s;
        font-size: 14px;
    }
    
    .logout-btn-mobile:active {
        background: var(--error-color);
        color: white;
        transform: scale(0.95);
    }
    
    /* 底部导航栏 */
    .bottom-navbar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-card);
        border-top: 1px solid var(--border-color);
        display: flex;
        justify-content: space-around;
        align-items: center;
        padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
        z-index: 1000;
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
        height: 60px;
    }
    
    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: var(--text-secondary);
        padding: 8px 12px;
        min-width: 60px;
        transition: all 0.3s;
        border-radius: 8px;
    }
    
    .bottom-nav-item:active {
        transform: scale(0.95);
    }
    
    .bottom-nav-item.active {
        color: var(--primary-color);
    }
    
    .bottom-nav-icon {
        font-size: 22px;
        margin-bottom: 4px;
        transition: all 0.3s;
        display: block;
        filter: grayscale(100%);
        opacity: 0.6;
    }
    
    .bottom-nav-item.active .bottom-nav-icon {
        transform: scale(1.1);
        filter: grayscale(0%);
        opacity: 1;
    }
    
    .bottom-nav-text {
        font-size: 12px;
        font-weight: 500;
    }
    
    /* 隐藏桌面端导航菜单 */
    .navbar-menu-desktop {
        display: none;
    }
    
    .navbar {
        padding: 12px 0;
        margin-bottom: 12px;
    }
    
    .navbar-brand {
        font-size: 18px;
    }
    
    /* 按钮样式优化 */
    .btn {
        padding: 10px 20px;
        font-size: 15px;
        border-radius: 8px;
    }
    
    .btn-primary,
    .btn-success {
        font-weight: 500;
    }
    
    /* 表单输入框 */
    .form-input {
        padding: 12px 14px;
        font-size: 16px; /* 防止iOS自动缩放 */
        border-radius: 8px;
    }
    
    /* 统计卡片网格 */
    .card > div[style*="grid"] {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    
    /* 步骤条 */
    .steps {
        flex-direction: column;
        gap: 16px;
    }
    
    .steps::before {
        display: none;
    }
    
    /* 验证码 */
    .captcha-group {
        flex-direction: column;
    }
    
    .captcha-img {
        width: 100%;
    }
    
    .navbar-content {
        padding: 0 12px;
    }
    
    /* 表格 */
    .table {
        font-size: 13px;
    }
    
    .table th,
    .table td {
        padding: 10px 8px;
    }
    
    /* 模态框 */
    .modal-content {
        padding: 20px;
        border-radius: 12px;
        margin: 20px;
        max-height: calc(100vh - 40px);
    }
    
    .modal-header {
        font-size: 17px;
        margin-bottom: 16px;
    }
    
    /* 提示信息 */
    .alert {
        padding: 12px 14px;
        font-size: 14px;
        border-radius: 8px;
        margin-bottom: 16px;
    }
    
    /* 状态标签 */
    .status-badge {
        padding: 4px 10px;
        font-size: 11px;
    }
    
    /* 底部提示 */
    .footer-tip {
        padding: 10px 12px;
        font-size: 11px;
        bottom: 60px; /* 在底部导航栏上方 */
    }
    
    /* 产品卡片优化 */
    .product-card {
        transition: transform 0.2s, box-shadow 0.2s;
    }
    
    .product-card:active {
        transform: scale(0.98);
    }
    
    /* 统计卡片数字优化 */
    .card > div[style*="font-size: 32px"],
    .card > div[style*="font-size: 24px"] {
        font-size: 22px !important;
    }
    
    /* 按钮组优化 */
    .btn-group {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .btn-group .btn {
        flex: 1;
        min-width: 100px;
    }
    
    /* 输入框组优化 */
    .form-group {
        margin-bottom: 16px;
    }
    
    /* 表格容器优化 */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* 卡片内网格优化 */
    .card-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    /* 金额显示优化 */
    .amount-display {
        font-size: 20px;
        font-weight: 600;
        color: var(--primary-color);
    }
    
    /* 标签组优化 */
    .label-value-group {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
    }
    
    .label-value-group .label {
        font-size: 14px;
        color: var(--text-secondary);
    }
    
    .label-value-group .value {
        font-size: 15px;
        font-weight: 500;
        color: var(--text-primary);
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
}

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

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* 文件上传 */
.file-upload {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.file-upload:hover {
    border-color: var(--primary-color);
    background: rgba(24, 144, 255, 0.05);
}

.file-upload input[type="file"] {
    display: none;
}

.file-preview {
    margin-top: 16px;
}

.file-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
}

/* 底部提示 */
.footer-tip {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    padding: 12px 20px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-secondary);
    z-index: 100;
}

.footer-tip-content {
    max-width: 1200px;
    margin: 0 auto;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

.modal-footer {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}




