/**
 * 全站统一样式
 * 用于替代各HTML页面内联的公共CSS
 * 版本: 1.0.0
 * 更新: 2026-01-07
 * 
 * 使用方法：
 * 在HTML的<head>中添加：
 * <link rel="stylesheet" href="css/theme-vars.css">
 * <link rel="stylesheet" href="css/unified.css">
 * 
 * 可以删除页面内大部分内联<style>标签
 */

/* ===== 导入布局和组件 ===== */
@import url('./layout/layout.css');
@import url('./components/components.css');

/* ===== 导入原有组件样式（保持兼容性）===== */
@import url('./components/common-ui.css');
@import url('./components/payment.css');
@import url('./components/vip-system.css');

/* ===== 全局基础样式 ===== */
/* 注意：不要重置全局margin/padding，会影响现有布局 */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Segoe UI', 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-cyan);
}

img {
    max-width: 100%;
    height: auto;
}

/* ===== 通用按钮 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-blue);
    color: #fff;
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.btn-success {
    background: var(--accent-green);
    color: #fff;
}

.btn-success:hover {
    filter: brightness(1.1);
}

.btn-warning {
    background: var(--accent-orange);
    color: #fff;
}

.btn-warning:hover {
    filter: brightness(1.1);
}

.btn-danger {
    background: var(--accent-red);
    color: #fff;
}

.btn-danger:hover {
    filter: brightness(1.1);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== 表单元素 ===== */
input, select, textarea {
    font-family: inherit;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

.form-control::placeholder {
    color: var(--text-secondary);
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.form-text {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 5px;
}

.form-error {
    font-size: 12px;
    color: var(--accent-red);
    margin-top: 5px;
}

/* ===== 表格样式 ===== */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: var(--bg-card-hover);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

td {
    font-size: 14px;
}

tr:hover td {
    background: rgba(88, 166, 255, 0.05);
}

/* ===== 工具类 ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--accent-green); }
.text-warning { color: var(--accent-yellow); }
.text-danger { color: var(--accent-red); }
.text-info { color: var(--accent-blue); }

.bg-success { background: rgba(52, 211, 153, 0.15); }
.bg-warning { background: rgba(210, 153, 34, 0.15); }
.bg-danger { background: rgba(248, 81, 73, 0.15); }
.bg-info { background: rgba(88, 166, 255, 0.15); }

.fw-normal { font-weight: 400; }
.fw-medium { font-weight: 500; }
.fw-semibold { font-weight: 600; }
.fw-bold { font-weight: 700; }

.fs-sm { font-size: 12px; }
.fs-md { font-size: 14px; }
.fs-lg { font-size: 16px; }
.fs-xl { font-size: 18px; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.d-grid { display: grid; }

.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.align-items-center { align-items: center; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.gap-1 { gap: 5px; }
.gap-2 { gap: 10px; }
.gap-3 { gap: 15px; }
.gap-4 { gap: 20px; }

.m-0 { margin: 0; }
.mt-1 { margin-top: 5px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 15px; }
.mt-4 { margin-top: 20px; }
.mb-1 { margin-bottom: 5px; }
.mb-2 { margin-bottom: 10px; }
.mb-3 { margin-bottom: 15px; }
.mb-4 { margin-bottom: 20px; }

.p-0 { padding: 0; }
.p-1 { padding: 5px; }
.p-2 { padding: 10px; }
.p-3 { padding: 15px; }
.p-4 { padding: 20px; }

.rounded { border-radius: 8px; }
.rounded-lg { border-radius: 12px; }
.rounded-full { border-radius: 50%; }

.shadow { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); }
.shadow-lg { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2); }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

.cursor-pointer { cursor: pointer; }
.user-select-none { user-select: none; }

/* ===== 响应式隐藏 ===== */
@media (max-width: 768px) {
    .hide-mobile { display: none !important; }
}

@media (min-width: 769px) {
    .hide-desktop { display: none !important; }
}

/* ===== 动画 ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease;
}

.animate-slideUp {
    animation: slideUp 0.3s ease;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ===== 选中文本颜色 ===== */
::selection {
    background: var(--accent-blue);
    color: #fff;
}
