/* 通用样式文件 */

/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', Arial, sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 25px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

.btn:hover {
    background: linear-gradient(135deg, #0056b3, #004085);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 123, 255, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.2);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #5a6268, #4a5157);
    box-shadow: 0 6px 16px rgba(108, 117, 125, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c82333, #bd2130);
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid #007bff;
    color: #007bff;
    box-shadow: none;
}

.btn-outline:hover {
    background: #007bff;
    color: #fff;
}

/* 卡片样式 */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-3px);
}

.card-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.card-title {
    font-size: 18px;
    color: #333;
    font-weight: 600;
    margin: 0;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-control::placeholder {
    color: #999;
}

.form-text {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* 表格样式 */
.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.table th {
    background: #f8f9fa;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #f0f0f0;
}

.table td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.table tr:hover {
    background: #f8f9fa;
}

.table tr:last-child td {
    border-bottom: none;
}

/* 消息样式 */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-success {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.alert-info {
    background: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* 工具类 */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mt-1 { margin-top: 5px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 15px; }
.mt-4 { margin-top: 20px; }
.mt-5 { margin-top: 25px; }

.mb-1 { margin-bottom: 5px; }
.mb-2 { margin-bottom: 10px; }
.mb-3 { margin-bottom: 15px; }
.mb-4 { margin-bottom: 20px; }
.mb-5 { margin-bottom: 25px; }

.ml-1 { margin-left: 5px; }
.ml-2 { margin-left: 10px; }
.ml-3 { margin-left: 15px; }
.ml-4 { margin-left: 20px; }
.ml-5 { margin-left: 25px; }

.mr-1 { margin-right: 5px; }
.mr-2 { margin-right: 10px; }
.mr-3 { margin-right: 15px; }
.mr-4 { margin-right: 20px; }
.mr-5 { margin-right: 25px; }

.p-1 { padding: 5px; }
.p-2 { padding: 10px; }
.p-3 { padding: 15px; }
.p-4 { padding: 20px; }
.p-5 { padding: 25px; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-inline-block { display: inline-block; }

.flex-column { flex-direction: column; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.align-items-center { align-items: center; }

/* 响应式工具类 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .btn {
        padding: 8px 20px;
        font-size: 13px;
    }
    
    .card {
        padding: 20px;
    }
    
    .table th,
    .table td {
        padding: 12px;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 10px;
    }
    
    .btn {
        padding: 6px 15px;
        font-size: 12px;
    }
    
    .card {
        padding: 15px;
    }
}

/* ========== 认证页面公用样式 ========== */
.auth-wrapper {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    overflow: hidden;
    /* 默认渐变兜底，实际背景图在各页面 <style> 中通过 .auth-wrapper 覆盖 */
    background: #1a1a2e;
}

/* 背景图层 */
.auth-bg-layer {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: brightness(0.55);
    transform: scale(1.05);
    transition: transform 8s ease;
}
.auth-wrapper:hover .auth-bg-layer { transform: scale(1.1); }

/* 背景装饰粒子 */
.auth-bg-particles {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(circle at 15% 20%, rgba(255,255,255,0.06) 0%, transparent 50%),
        radial-gradient(circle at 85% 70%, rgba(255,255,255,0.04) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255,255,255,0.03) 0%, transparent 40%);
}

.auth-card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.25),
        0 8px 20px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    overflow: hidden;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.auth-header {
    position: relative;
    padding: 40px 30px 35px;
    text-align: center;
    color: #fff;
    overflow: hidden;
}

/* 头部增加微光泽 */
.auth-header::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 60%);
    pointer-events: none;
}

.auth-header.auth-blue  { background: linear-gradient(135deg, #1a6dff, #003eb3); }
.auth-header.auth-green { background: linear-gradient(135deg, #2ecc71, #1a7a3a); }

.auth-header .auth-icon {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    font-size: 28px;
    backdrop-filter: blur(10px);
}

.auth-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
}
.auth-header p {
    font-size: 14px;
    opacity: 0.85;
}

.auth-body { padding: 30px; background: transparent; }

.auth-body .form-group { margin-bottom: 18px; }
.auth-body .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.auth-input {
    position: relative;
}
.auth-input .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    font-size: 16px;
    pointer-events: none;
    transition: color 0.3s;
}
.auth-input input {
    width: 100%;
    padding: 13px 15px 13px 42px;
    border: 2px solid rgba(0,0,0,0.08);
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: rgba(248, 250, 252, 0.7);
    backdrop-filter: blur(4px);
}
.auth-input input:focus {
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.08);
}
.auth-input.auth-blue input:focus { border-color: #007bff; box-shadow: 0 0 0 3px rgba(0,123,255,0.08); }
.auth-input.auth-green input:focus { border-color: #28a745; box-shadow: 0 0 0 3px rgba(40,167,69,0.08); }
.auth-input input:focus ~ .input-icon { color: #007bff; }
.auth-input.auth-green input:focus ~ .input-icon { color: #28a745; }

/* 短信组 */
.sms-group {
    display: flex;
    gap: 10px;
}
.sms-group .auth-input { flex: 1; }

.sms-btn {
    min-width: 120px;
    padding: 13px 15px;
    border: 2px solid;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    backdrop-filter: blur(6px);
}
.sms-btn.sms-blue   { border-color: #007bff; color: #007bff; }
.sms-btn.sms-green  { border-color: #28a745; color: #28a745; }
.sms-btn.sms-blue:hover:not(:disabled)  { background: #007bff; color: #fff; }
.sms-btn.sms-green:hover:not(:disabled) { background: #28a745; color: #fff; }
.sms-btn:disabled {
    border-color: #d0d5dd; color: #999; cursor: not-allowed; background: rgba(245, 245, 245, 0.7);
}

.sms-hint {
    font-size: 12px; color: #999; margin-top: 6px;
    display: flex; align-items: center; gap: 4px;
}

/* 提交按钮 */
.auth-submit {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
    color: #fff;
    letter-spacing: 1px;
}
.auth-submit.auth-blue  { background: linear-gradient(135deg, #1a6dff, #004de6); box-shadow: 0 6px 20px rgba(26,109,255,0.3); }
.auth-submit.auth-green { background: linear-gradient(135deg, #2ecc71, #1fa855); box-shadow: 0 6px 20px rgba(46,204,113,0.3); }
.auth-submit:hover { transform: translateY(-2px); }
.auth-submit.auth-blue:hover  { box-shadow: 0 8px 28px rgba(26,109,255,0.45); }
.auth-submit.auth-green:hover { box-shadow: 0 8px 28px rgba(46,204,113,0.45); }
.auth-submit:active { transform: translateY(0); }

/* 底部链接 */
.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.auth-footer p { color: #888; font-size: 14px; }
.auth-footer a { text-decoration: none; font-weight: 600; transition: color 0.2s; }
.auth-footer a.auth-link-blue  { color: #007bff; }
.auth-footer a.auth-link-green { color: #28a745; }
.auth-footer a:hover { text-decoration: underline; }
.auth-footer a.auth-link-blue:hover  { color: #0056b3; }
.auth-footer a.auth-link-green:hover { color: #1e7e34; }

/* 切换标签（登录页专用） */
.auth-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 28px;
}
.auth-tab {
    flex: 1;
    padding: 10px 20px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    color: #777;
    cursor: pointer;
    transition: all 0.3s ease;
}
.auth-tab.active {
    background: rgba(255, 255, 255, 0.95);
    color: #007bff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    font-weight: 600;
}
.auth-panel { display: none; animation: fadeIn 0.4s ease; }
.auth-panel.active { display: block; }

/* 密码强度条（注册页专用） */
.pw-strength {
    margin-top: 8px;
    height: 4px;
    background: #e8ecf1;
    border-radius: 2px;
    overflow: hidden;
}
.pw-strength-bar {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease, background 0.3s ease;
    width: 0;
}
.pw-strength-text {
    font-size: 12px;
    margin-top: 4px;
    color: #999;
    text-align: right;
}

/* 协议勾选 */
.agreement {
    font-size: 13px;
    color: #888;
    text-align: center;
    margin-bottom: 16px;
    line-height: 1.6;
}
.agreement a { color: #28a745; text-decoration: none; }
.agreement a:hover { text-decoration: underline; }

/* 忘记密码链接 */
.forgot-link {
    text-align: right;
    margin-bottom: 20px;
}
.forgot-link a {
    color: #007bff;
    font-size: 13px;
    text-decoration: none;
}
.forgot-link a:hover { text-decoration: underline; }

/* 消息提示（认证页微调） */
.auth-alerts { margin-bottom: 20px; }
.auth-alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.6;
    animation: fadeIn 0.3s ease;
}
.auth-alert-danger {
    background: rgba(255, 242, 240, 0.85);
    border: 1px solid rgba(255, 204, 199, 0.6);
    color: #cf1322;
    backdrop-filter: blur(4px);
}
.auth-alert-danger p { margin: 2px 0; }
.auth-alert-success {
    background: rgba(246, 255, 237, 0.85);
    border: 1px solid rgba(183, 235, 143, 0.6);
    color: #389e0d;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    backdrop-filter: blur(4px);
}

/* 认证页响应式 */
@media (max-width: 480px) {
    .auth-card { border-radius: 16px; }
    .auth-header { padding: 28px 20px 24px; }
    .auth-header h1 { font-size: 20px; }
    .auth-body { padding: 20px; }
    .sms-btn { min-width: 100px; font-size: 13px; padding: 13px 10px; }
}

/* 动画类 */
.fade-in {
    animation: fadeIn 0.5s ease;
}

.slide-up {
    animation: slideUp 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 选择文本样式 */
::selection {
    background: rgba(0, 123, 255, 0.2);
    color: #007bff;
}

/* 占位符样式 */
.placeholder {
    background: #f8f9fa;
    border-radius: 8px;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-style: italic;
}

.placeholder-lg {
    min-height: 200px;
}

.placeholder-sm {
    min-height: 50px;
}

/* 分割线 */
.divider {
    height: 1px;
    background: #f0f0f0;
    margin: 20px 0;
}

.divider-dashed {
    background: repeating-linear-gradient(
        90deg,
        #f0f0f0,
        #f0f0f0 5px,
        transparent 5px,
        transparent 10px
    );
}

/* 徽章 */
.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 12px;
    color: #fff;
}

.badge-primary {
    background: linear-gradient(135deg, #007bff, #0056b3);
}

.badge-success {
    background: linear-gradient(135deg, #28a745, #218838);
}

.badge-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
}

.badge-warning {
    background: linear-gradient(135deg, #ffc107, #e0a800);
}

.badge-info {
    background: linear-gradient(135deg, #17a2b8, #138496);
}

/* 标签 */
.tag {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 4px;
    background: #f8f9fa;
    color: #666;
    margin-right: 5px;
    margin-bottom: 5px;
    border: 1px solid #e9ecef;
}

.tag:hover {
    background: #e9ecef;
    text-decoration: none;
}