/* ---------- 全局重置 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #f5f7fa 0%, #eef2f7 100%);
    font-family: 'Inter', system-ui, sans-serif;
}
/* ---------- 头部 ---------- */
.header { background: rgba(255,255,255,0.95); backdrop-filter: blur(10px); border-bottom: 1px solid rgba(226,232,240,0.6); position: sticky; top: 0; z-index: 100; }
.header-container { max-width: 1280px; margin: 0 auto; padding: 1rem 1.5rem; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; }
.logo-area { cursor: pointer; transition: opacity 0.2s; text-decoration: none; display: flex; align-items: center; gap: 12px; }
.logo-area:hover { opacity: 0.85; }
.logo-icon { font-size: 2rem; }
.logo-text h1 { font-size: 1.5rem; font-weight: 700; background: linear-gradient(135deg, #1a2a3f, #1e3c5c); background-clip: text; -webkit-background-clip: text; color: transparent; }

/* 登录按钮 */
.login-btn-style {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #1f2937;
    font-weight: 500;
    transition: all 0.2s;
}
.login-btn-style .icon-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background-color: #f3f4f6;
    border-radius: 50%;
    color: #4b5563;
    transition: all 0.2s;
}
.login-btn-style:hover {
    color: #3b82f6;
}
.login-btn-style:hover .icon-circle {
    background-color: #e0e7ff;
    color: #3b82f6;
}

/* ========== 用户菜单 - 与登录按钮风格统一 ========== */
.user-nav-area { margin-left: auto; }
.user-dropdown { position: relative; display: inline-block; }
.user-btn-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #f3f4f6;
    padding: 6px 16px 6px 8px;
    border-radius: 40px;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: #1f2937;
}
.user-btn-wrapper:hover {
    background-color: #e0e7ff;
    box-shadow: 0 2px 8px rgba(59,130,246,0.15);
}
.user-icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background-color: #ffffff;
    border-radius: 50%;
    color: #4b5563;
    transition: all 0.2s;
}
.user-btn-wrapper:hover .user-icon-wrapper {
    background-color: #ffffff;
    color: #3b82f6;
    transform: scale(1.02);
}
.username { font-size: 0.95rem; font-weight: 500; color: #1f2937; }
.dropdown-arrow { font-size: 0.7rem; color: #6b7280; transition: transform 0.2s ease; }
.user-dropdown.open .dropdown-arrow { transform: rotate(180deg); }
.user-dropdown .dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 200px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 35px -12px rgba(0,0,0,0.15);
    padding: 8px 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 1000;
    border: 1px solid #f0f2f5;
}
.user-dropdown.open .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: #374151;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.15s;
}
.dropdown-item i { width: 20px; font-size: 1rem; color: #6b7280; }
.dropdown-item:hover { background: #f8fafc; color: #111827; }
.dropdown-item:hover i { color: #3b82f6; }
.logout-item { color: #dc2626; }
.logout-item i { color: #f87171; }
.logout-item:hover { background: #fef2f2; color: #b91c1c; }
.logout-item:hover i { color: #dc2626; }
.dropdown-divider { height: 1px; margin: 8px 0; background: #edf2f7; }

/* ---------- 主内容容器 ---------- */
/* 替换原有 .tools-container 样式 */
.tools-container {
    flex: 1;                    /* 关键：占据剩余空间 */
    width: 100%;
    max-width: 1280px;        /* 与头部最大宽度一致 */
    margin: 0 auto;           /* 水平居中 */
    padding: 2rem 1.5rem;     /* 上下2rem，左右1.5rem（与头部内边距一致） */
}

/* ---------- 页脚 ---------- */
.footer { background: #1f2f44; color: #cbd5e1; padding: 1.8rem 1.5rem; text-align: center; font-size: 0.8rem; }
.footer a { color: #9ab3d5; text-decoration: none; margin: 0 0.5rem; }

/* ---------- 闪存消息 ---------- */
.alert { padding: 12px; border-radius: 8px; margin-bottom: 15px; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-danger { background: #fee2e2; color: #991b1b; }

/* ========== 全局设计变量 ========== */
:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border: #e5e7eb;
    --bg-page: #f8fafc;
    --card-white: #ffffff;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
    --radius-card: 24px;
    --radius-btn: 40px;
    --radius-input: 16px;
}

/* ========== 通用卡片组件 ========== */
.data-card,
.profile-form-card,
.membership-card,
.plan-card {
    background: var(--card-white);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    padding: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.data-card:hover,
.plan-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

/* 卡片头部 */
.card-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}
.card-title h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}
.title-icon { font-size: 1.3rem; }

/* 表单样式 */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-main);
}
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-input);
    font-size: 0.95rem;
    transition: 0.2s;
    background: white;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.form-hint {
    display: block;
    margin-top: 5px;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.error-message {
    display: block;
    margin-top: 5px;
    font-size: 0.75rem;
    color: var(--danger);
}

/* 按钮 */
.btn-primary, .btn-save, .btn-buy:not(:disabled) {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius-btn);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}
.btn-primary:hover, .btn-save:hover, .btn-buy:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 8px 20px;
    border-radius: var(--radius-btn);
    cursor: pointer;
}
.btn-outline:hover { background: #f3f4f6; }

/* 表格 */
.table-responsive { overflow-x: auto; }
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.data-table th { background: #f8fafc; font-weight: 600; }

/* 状态徽章 */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 500;
}
.status-badge.pending { background: #fef3c7; color: #92400e; }
.status-badge.running { background: #dbeafe; color: #1e40af; }
.status-badge.completed,
.status-badge.paid { background: #d1fae5; color: #065f46; }
.status-badge.failed { background: #fee2e2; color: #991b1b; }

/* 分页 */
.pagination-container {
    margin-top: 30px;
    text-align: center;
}
.pagination-nav {
    display: inline-flex;
    gap: 12px;
    background: #f3f4f6;
    padding: 6px 20px;
    border-radius: 50px;
}
.page-link {
    text-decoration: none;
    color: var(--primary);
    padding: 6px 14px;
    border-radius: 30px;
}
.page-current {
    background: white;
    padding: 6px 14px;
    border-radius: 30px;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-content {
    background: white;
    border-radius: 24px;
    width: 90%;
    max-width: 500px;
    animation: fadeInUp 0.3s;
}
.modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-body { padding: 24px; }
.close { font-size: 28px; cursor: pointer; }
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-icon { font-size: 4rem; margin-bottom: 16px; }

/* 会员等级 / 余额专用 */
.points-section {
    background: #f8fafc;
    border-radius: 20px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}
.points-amount {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}
.points-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary);
}
.level-badge {
    display: inline-block;
    padding: 8px 24px;
    border-radius: 40px;
    font-weight: bold;
}
.level-badge.free { background: #e5e7eb; color: #6b7280; }
.level-badge.basic { background: #dbeafe; color: #1e40af; }
.level-badge.pro { background: #fed7aa; color: #9a3412; }
.level-badge.enterprise { background: #e0e7ff; color: #4338ca; }

/* 套餐网格 */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

/* 手机号认证专用 */
.phone-group {
    display: flex;
    align-items: center;
    gap: 12px;
}
.phone-group .form-control { flex: 1; }
.verify-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    white-space: nowrap;
}
.verify-badge.verified {
    background: #d1fae5;
    color: #065f46;
}

/* 响应式 */
@media (max-width: 768px) {
    .header-container { flex-direction: column; align-items: stretch; }
    .user-nav-area { margin-left: 0; text-align: right; }
    .data-table th, .data-table td { padding: 8px; font-size: 0.8rem; }
    .plans-grid { grid-template-columns: 1fr; }
}