/* ============================================================
   星辉自学 · 全局共享样式
   配色取法传统国画：中国红 / 古典蓝 / 鎏金 / 宣纸
   零依赖：字体使用系统本地字体，不加载任何外部资源
   ============================================================ */

:root {
    /* 主色 */
    --china-red: #C41E3A;
    --china-red-dark: #8B0000;
    --china-red-light: #E8B4B8;
    --classic-blue: #1E3A5F;
    --classic-blue-light: #4A6FA5;
    --classic-blue-pale: #D4E4F7;
    --gold: #C9A961;
    --gold-light: #E6D3A0;

    /* 中性色 */
    --ink-black: #2C2C2C;
    --ink-soft: #4a4a4a;
    --paper: #F7F3E9;
    --paper-dark: #EDE8D8;
    --paper-deep: #E2DBC7;

    /* 状态色 */
    --success: #5a8a3e;
    --warning: #d48806;
    --danger: #C41E3A;
    --info: #4A6FA5;

    /* 阴影与圆角 */
    --shadow-sm: 0 2px 8px rgba(30, 58, 95, 0.08);
    --shadow-md: 0 4px 20px rgba(30, 58, 95, 0.12);
    --shadow-lg: 0 8px 40px rgba(30, 58, 95, 0.18);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;

    --font-serif: 'SimSun', '宋体', 'Songti SC', 'Noto Serif SC', serif;
    --font-sans: 'Microsoft YaHei', '微软雅黑', 'PingFang SC', 'Noto Sans SC', sans-serif;
}

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

html, body {
    font-family: var(--font-sans);
    background: var(--paper);
    color: var(--ink-black);
    line-height: 1.7;
    font-size: 15px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overflow-x: hidden;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c9a961' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

a { color: var(--classic-blue); text-decoration: none; transition: color .2s; -webkit-tap-highlight-color: transparent; }
a:hover { color: var(--china-red); }

button {
    font-family: var(--font-sans);
    cursor: pointer;
    border: none;
    outline: none;
    transition: all .2s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

input, select, textarea {
    font-family: var(--font-sans);
    outline: none;
}

/* ====== 顶部彩条 ====== */
.top-border {
    height: 5px;
    background: linear-gradient(90deg, var(--china-red-dark), var(--china-red), var(--gold), var(--classic-blue), var(--classic-blue-light));
}

/* ====== 通用按钮 ====== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all .2s;
    white-space: nowrap;
}
.btn-primary { background: var(--china-red); color: #fff; }
.btn-primary:hover { background: var(--china-red-dark); }
.btn-blue { background: var(--classic-blue); color: #fff; }
.btn-blue:hover { background: #162d4a; }
.btn-gold { background: var(--gold); color: var(--ink-black); }
.btn-gold:hover { background: var(--gold-light); }
.btn-ghost { background: transparent; color: var(--classic-blue); border-color: var(--classic-blue-light); }
.btn-ghost:hover { background: var(--classic-blue-pale); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-lg { padding: 12px 28px; font-size: 16px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ====== 卡片 ====== */
.card {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border-top: 3px solid var(--china-red);
    overflow: hidden;
    position: relative;
}
/* 鎏金角饰（参考国风提案页设计） */
.card::after {
    content: '';
    position: absolute;
    top: 8px; right: 8px;
    width: 22px; height: 22px;
    border-top: 2px solid var(--gold);
    border-right: 2px solid var(--gold);
    opacity: .45;
    pointer-events: none;
}
.card-blue { border-top-color: var(--classic-blue); }
.card-gold { border-top-color: var(--gold); }

.card-header {
    padding: 16px 22px;
    border-bottom: 1px solid var(--paper-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-header h3 {
    font-family: var(--font-serif);
    font-size: 18px;
    color: var(--classic-blue);
    font-weight: 700;
}
.card-body { padding: 22px; }

/* ====== 表单 ====== */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--ink-soft);
    font-size: 14px;
}
.form-control {
    width: 100%;
    padding: 9px 13px;
    border: 1px solid var(--paper-deep);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--paper);
    transition: border-color .2s, box-shadow .2s;
}
.form-control:focus {
    border-color: var(--classic-blue-light);
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.12);
    background: #fff;
}
textarea.form-control { resize: vertical; min-height: 80px; }

/* ====== 徽章 ====== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}
.badge-red { background: var(--china-red-light); color: var(--china-red-dark); }
.badge-blue { background: var(--classic-blue-pale); color: var(--classic-blue); }
.badge-gold { background: #f5ecd2; color: #8a6d2a; }
.badge-green { background: #e4f0db; color: var(--success); }
.badge-gray { background: #eee; color: #666; }

/* ====== 表格 ====== */
.table-wrap { overflow-x: auto; }
table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
table.data-table th, table.data-table td {
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid var(--paper-dark);
}
table.data-table th {
    background: var(--classic-blue);
    color: #fff;
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 1px;
}
table.data-table tbody tr:hover { background: var(--paper); }

/* ====== 工具类 ====== */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.text-red { color: var(--china-red); }
.text-blue { color: var(--classic-blue); }
.text-gold { color: var(--gold); }
.text-muted { color: #888; }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--paper); }
::-webkit-scrollbar-thumb { background: var(--paper-deep); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* 印章装饰 */
.seal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    background: var(--china-red);
    color: #fff;
    border-radius: 6px;
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 14px;
    border: 2px solid var(--gold);
    box-shadow: 0 2px 6px rgba(196, 30, 58, .3);
}

/* 提示 toast */
.toast-container {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    animation: toastIn .3s ease;
    min-width: 200px;
    text-align: center;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--info); }
.toast-warn { background: var(--warning); }
@keyframes toastIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 模态框 */
.modal-mask {
    position: fixed; inset: 0;
    background: rgba(44, 44, 44, .55);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal {
    background: #fff;
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    border-top: 4px solid var(--classic-blue);
}
.modal-header {
    padding: 16px 22px;
    border-bottom: 1px solid var(--paper-dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 { font-family: var(--font-serif); color: var(--classic-blue); font-size: 18px; }
.modal-close {
    background: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}
.modal-body { padding: 22px; }
.modal-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--paper-dark);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #aaa;
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; opacity: .5; }

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
}
.pagination button {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--paper-deep);
    background: #fff;
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.pagination button.active {
    background: var(--classic-blue);
    color: #fff;
    border-color: var(--classic-blue);
}
