/* ========================================
   用户认证系统样式
   登录/注册/忘记密码/个人中心
   ======================================== */

/* --- 认证页面通用样式 --- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    position: relative;
    overflow: hidden;
}

/* 背景装饰 */
.auth-bg-decor {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}
.decor-circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.06;
    background: radial-gradient(circle at center, #667eea, transparent);
}
.decor-1 { width: 600px; height: 600px; top: -200px; right: -100px; animation: decorFloat 20s ease-in-out infinite; }
.decor-2 { width: 400px; height: 400px; bottom: -100px; left: -80px;  animation: decorFloat 15s ease-in-out 3s infinite; }
.decor-3 { width: 300px; height: 300px; top: 40%; left: 50%;      animation: decorFloat 18s ease-in-out 6s infinite; }
@keyframes decorFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%  { transform: translate(30px, -20px) scale(1.05); }
    66%  { transform: translate(-20px, 15px) scale(0.95); }
}

.auth-container {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
}

/* 品牌标识 */
.auth-brand {
    text-align: center;
    margin-bottom: 8px;
}
.auth-brand .brand-icon {
    display: inline-block;
    margin-bottom: 10px;
    transition: transform 0.3s;
}
.auth-brand .brand-icon:hover {
    transform: scale(1.05);
}
.auth-brand .brand-icon svg {
    width: 48px;
    height: 48px;
}
.auth-brand h3 {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin: 0;
    letter-spacing: 1px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1);
    padding: 40px 36px;
    animation: cardSlideUp 0.5s ease-out;
}
@keyframes cardSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}
.auth-header h2 {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 6px;
}
.auth-header p {
    font-size: 14px;
    color: #888;
    margin: 0;
}

/* 输入框组 — 水平布局：label 与 input 同行 */
.auth-form .form-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 18px;
    gap: 0 10px;
}
.auth-form .form-group > label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    font-weight: 600;
    color: #444;
    letter-spacing: 0.3px;
    width: 64px;
    flex-shrink: 0;
    justify-content: flex-end;
    margin-bottom: 0;
}
.auth-form label .input-icon {
    color: #667eea;
    flex-shrink: 0;
}

/* 输入框包装 */
.input-wrapper {
    position: relative;
    flex: 1;
    min-width: 0;
}
.input-wrapper input {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    color: #333;
    background: #f8f9fc;
    border: 2px solid #e8ecf1;
    border-radius: 10px;
    outline: none;
    transition: all 0.3s;
    box-sizing: border-box;
}
.input-wrapper input:focus {
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.08);
}
.input-wrapper input::placeholder {
    color: #bbb;
}
.input-wrapper .input-focus-border {
    position: absolute;
    bottom: 0; left: 50%; transform: translateX(-50%);
    width: 0; height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 0 0 10px 10px;
    transition: width 0.3s;
}
.input-wrapper input:focus ~ .input-focus-border {
    width: calc(100% - 4px);
}
.input-wrapper.error input {
    border-color: #e74c3c;
    background: #fff8f8;
}
.input-wrapper.error .input-focus-border {
    background: #e74c3c;
}

/* 密码切换按钮 */
.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #bbb;
    transition: color 0.2s;
    line-height: 0;
    z-index: 1;
}
.password-toggle:hover,
.password-toggle.active {
    color: #667eea;
}

/* 错误消息 — 独占一行 */
.auth-form .error-message {
    font-size: 12px;
    color: #e74c3c;
    margin-top: 4px;
    min-height: 16px;
    line-height: 1.4;
    width: 100%;
    padding-left: 74px;
}

/* 验证码组 — label 与输入框+图片同行 */
.captcha-group .captcha-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
    flex: 1;
    min-width: 0;
}
.captcha-image-wrapper {
    position: relative;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid #e8ecf1;
    transition: all 0.3s;
}
.captcha-image-wrapper:hover {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.08);
}
.captcha-image {
    width: 120px;
    height: 40px;
    display: block;
    transition: opacity 0.3s;
}
.captcha-image.loading {
    opacity: 0.3;
}
.captcha-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 11px;
    opacity: 0;
    transition: opacity 0.25s;
    pointer-events: none;
}
.captcha-image-wrapper:hover .captcha-overlay {
    opacity: 1;
}

/* 按钮样式 */
.auth-form .btn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}
.auth-form .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.35);
}
.auth-form .btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.45);
}
.auth-form .btn-primary:active:not(:disabled) {
    transform: translateY(0);
}
.auth-form .btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}
.auth-form .btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #e8ecf1;
    box-shadow: none;
}
.auth-form .btn-outline:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.04);
    transform: none;
    box-shadow: none;
}
.btn-loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
/* spinner 动画由 SVG 内嵌 <animateTransform> 驱动，CSS 不再重复旋转 */

/* 链接区域 */
.auth-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 18px;
    font-size: 13px;
}
.auth-links a {
    color: #888;
    text-decoration: none;
    transition: color 0.3s;
}
.auth-links a strong {
    color: #667eea;
    font-weight: 600;
}
.auth-links a:hover {
    color: #667eea;
}

/* 底部版权 */
.auth-footer {
    text-align: center;
    margin-top: 20px;
}
.auth-footer p {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    margin: 0;
}

/* 复选框样式 */
.form-check {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.form-check-input {
    margin-top: 3px;
}

.form-check-label {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

.form-check-label a {
    color: #667eea;
    text-decoration: none;
}

.form-check-label a:hover {
    text-decoration: underline;
}

/* --- 个人中心样式 --- */
.user-center-page {
    padding: 40px 0 60px;
    min-height: calc(100vh - 200px);
    background: #f5f7fa;
}

/* 宽容器 — 参考 OurNews/Contact 的 .BriefInfo.container 模式 */
.user-center-container {
    width: 100%;
    max-width: 1400px;
    padding-left: 16px;
    padding-right: 16px;
    margin-left: auto;
    margin-right: auto;
}

/* flex 等高布局 — 参考 Contact 的 .contact 容器 */
.user-center-layout {
    display: flex;
    align-items: stretch;
    gap: 30px;
}
.user-center-layout::after {
    content: '';
    display: block;
    clear: both;
}

/* 左侧边栏 */
.user-sidebar {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    flex-shrink: 0;
    width: 260px;
}

.user-info-card {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.user-avatar {
    position: relative;
    display: inline-block;
    margin-bottom: 16px;
}

.user-avatar img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #667eea;
}

.avatar-upload-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 32px;
    height: 32px;
    background: #667eea;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.avatar-upload-btn:hover {
    background: #764ba2;
    transform: scale(1.1);
}

.user-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px;
}

.user-grade {
    font-size: 13px;
    color: #999;
    margin: 0;
}

/* 侧边导航 */
.user-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    font-size: 14px;
    color: #666;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s;
}

.user-nav .nav-item:hover {
    background: #f5f7fa;
    color: #667eea;
}

.user-nav .nav-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.user-nav .nav-item i {
    font-size: 18px;
}

.user-nav .nav-logout {
    color: #e74c3c;
    margin-top: 12px;
    border-top: 1px solid #eee;
    padding-top: 16px;
}

.user-nav .nav-logout:hover {
    background: #fee;
    color: #c0392b;
}

/* 右侧内容区 */
.user-content {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    flex: 1;
    min-width: 0;
    overflow-x: auto;
}

/* 内容标题 — 参考 Contact 的 .pull-Left h1/h2 风格 */
.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 30px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f2f5;
}

.content-header h2 {
    font-size: 22px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
}

.content-header .btn-sm {
    padding: 6px 18px;
    font-size: 13px;
    border-radius: 6px;
    white-space: nowrap;
}

/* ---- Tab 面板 ---- */
.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* ---- 个人信息表单 ---- */
.profile-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 24px;
    margin-bottom: 20px;
}

/* 单字段行自动撑满 (性别、注册时间) */
.profile-form .form-row > .form-group:only-child {
    grid-column: 1 / -1;
}

.profile-form .form-group {
    margin-bottom: 0;
}

.profile-form label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 6px;
}

.profile-form .form-control {
    width: 100%;
    padding: 9px 14px;
    font-size: 14px;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: all 0.3s;
    box-sizing: border-box;
}

.profile-form .form-control:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.profile-form .form-control[readonly] {
    background: #f5f7fa;
    cursor: default;
    color: #777;
}

/* ---- 密码修改表单 ---- */
.password-form .form-group {
    margin-bottom: 18px;
}
.password-form label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}
.password-form .form-control {
    width: 100%;
    max-width: 420px;
    padding: 10px 14px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: all 0.3s;
}
.password-form .form-control:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 帮助文本 */
.help-text {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* ---- 性别单选按钮组 ---- */
.radio-group {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 10px 0;
}

.radio-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

.radio-inline input[type="radio"] {
    accent-color: #667eea;
}

/* ---- 操作按钮 ---- */
.form-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.form-actions .btn {
    padding: 12px 32px;
    font-size: 15px;
    font-weight: 500;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.form-actions .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.form-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ===== 数据列表 ===== */
.data-list {
    min-height: 200px;
}

.loading-state,
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 14px;
}

/* ===== 卡片网格 ===== */
.project-cards,
.contract-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.project-card,
.contract-card {
    padding: 20px;
    border: 1px solid #eee;
    border-radius: 8px;
    transition: all 0.3s;
}

.project-card:hover,
.contract-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.project-card h4,
.contract-card h4 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px;
}

.project-card p,
.contract-card p {
    font-size: 13px;
    color: #666;
    margin: 8px 0;
}

/* ===== 表格 ===== */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.table thead th {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    background: #f5f7fa;
    border-bottom: 2px solid #ddd;
    text-align: left;
}

.table tbody td {
    padding: 12px 16px;
    font-size: 13px;
    color: #666;
    border-bottom: 1px solid #eee;
}

.table-striped tbody tr:nth-child(even) {
    background: #fafafa;
}

/* ===== 徽章 ===== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 12px;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

/* ===== 分页 ===== */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.pagination {
    display: flex;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.page-item .page-link {
    display: block;
    padding: 8px 14px;
    font-size: 13px;
    color: #667eea;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 6px;
    transition: all 0.3s;
}

.page-item .page-link:hover {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

.page-item.active .page-link {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

/* ===== 卡片详情面板 ===== */
.card-detail {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #e0e0e0;
    font-size: 13px;
    color: #888;
}

.card-detail p {
    margin: 4px 0;
    color: #888;
}

/* ===== 可点击表格行 ===== */
.clickable-row {
    cursor: pointer;
    transition: background 0.2s;
}
.clickable-row:hover {
    background: #f0f4ff !important;
}
.clickable-row td:last-child {
    text-align: center;
    color: #999;
    font-size: 12px;
}

/* 详情展开行 */
.detail-row td {
    background: #f9fafb;
    padding: 16px 20px !important;
}
.detail-content {
    font-size: 13px;
    color: #555;
    line-height: 1.8;
}
.detail-content p {
    margin: 4px 0;
}
.detail-content strong {
    color: #333;
}

/* ===== Header 用户下拉菜单 ===== */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.user-avatar-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.3s;
}

.user-avatar-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-nickname {
    font-size: 14px;
    font-weight: 500;
}

.user-dropdown .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    min-width: 180px;
    display: none;
    z-index: 1000;
}

.user-dropdown:hover .dropdown-menu {
    display: block;
}

.user-dropdown .dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    transition: background 0.3s;
}

.user-dropdown .dropdown-menu a:hover {
    background: #f5f7fa;
    color: #667eea;
}

.user-dropdown .dropdown-menu a i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* ===== 警告框 ===== */
.alert {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
    margin: 0;
}
.alert svg {
    flex-shrink: 0;
}

.alert-success {
    background: #eafaf1;
    color: #155724;
}
.alert-danger {
    background: #fef0f0;
    color: #c0392b;
    border: 1px solid #fce4e4;
}

/* --- 响应式适配 — 参考 OurNews 渐进式缩小 --- */

/* 1300px */
@media (max-width: 1300px) {
    .user-sidebar { width: 240px; }
    .user-center-container { max-width: 1100px; }
}

/* 1100px */
@media (max-width: 1100px) {
    .user-sidebar { width: 220px; }
    .user-center-container { max-width: 900px; }
}

/* 992px：垂直堆叠 */
@media (max-width: 992px) {
    .user-center-layout {
        display: block;
    }

    .user-sidebar {
        width: 100%;
        position: static;
        max-height: none;
        overflow-y: visible;
        margin-bottom: 20px;
    }

    .user-content {
        width: 100%;
    }

    .user-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 4px;
    }

    .user-nav .nav-item {
        flex: 1;
        min-width: 100px;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .auth-card {
        padding: 30px 22px;
        border-radius: 14px;
    }
    .auth-header h2 {
        font-size: 22px;
    }
    .auth-form .form-group > label {
        width: 52px;
        font-size: 13px;
    }
    .auth-form .error-message {
        padding-left: 62px;
    }
    .captcha-image {
        width: 100px;
        height: 36px;
    }
    .profile-form .form-row {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .project-cards,
    .contract-cards {
        grid-template-columns: 1fr;
    }
    .user-center-page {
        padding: 16px 0 40px;
    }
    .user-center-container {
        padding-left: 12px;
        padding-right: 12px;
    }
    .user-content {
        padding: 20px 16px;
    }
    .user-sidebar {
        padding: 20px 16px;
    }
    .content-header h2 {
        font-size: 18px;
    }
}

@media (max-width: 576px) {
    .auth-page {
        padding: 20px 10px;
    }
    .auth-card {
        padding: 20px 16px;
    }
    .auth-form .form-group {
        flex-direction: column;
        align-items: stretch;
    }
    .auth-form .form-group > label {
        width: 100%;
        justify-content: flex-start;
        margin-bottom: 4px;
    }
    .auth-form .error-message {
        padding-left: 0;
    }
    .captcha-group .captcha-wrapper {
        flex-direction: column;
    }
    .auth-links {
        flex-direction: column;
        gap: 10px;
    }
    /* 个人中心超窄屏 */
    .user-center-page {
        padding: 12px 0 32px;
    }
    .user-center-container {
        padding-left: 8px;
        padding-right: 8px;
    }
    .user-sidebar,
    .user-content {
        padding: 16px 12px;
    }
    .user-avatar img {
        width: 48px;
        height: 48px;
    }
    .user-nav .nav-item {
        font-size: 12px;
        padding: 8px 10px;
    }
}