/* ===========================================================================
 * 滕州一中招生信息采集系统 — 响应式样式
 * ---------------------------------------------------------------------------
 * 配色体系（暖色调，与门户 index.php 的 css/portal.css 同源，取色自校徽）
 *
 *   品牌红（校徽红）  #c8231e  主色：标题 / 主按钮 / 链接 / 选中态 / 焦点环
 *                     #a81b16  悬停 / 页头渐变暗端
 *                     #c03a18  页头渐变亮端
 *                     #fdeceb  主色浅底（合计行 / 高亮框）
 *
 *   暖金 / 琥珀       #a86400  强调文字（管理员徽章，4.68:1）
 *                     #b4510a  次要链接
 *                     #fff8e6 / #f0d090 / #ffe08a / #e0b84a / #6b5200
 *                              提示条、安全退出按钮等既有暖色，予以保留
 *
 *   成功绿（暖调）    #1e7a45  #155c33(悬停)  #1e8e4e  #e8f6ec 底  #eaf6ee 底
 *
 *   危险红（深绛）    #a4160f  按钮底  #7d0f0a(悬停)  #b02a1e 文字  #fdecec 底
 *                     ※ 与品牌红拉明明度差：品牌红亮（5.65:1），危险红深（6.57:1），
 *                       二者不同屏竞争（危险按钮仅出现于注销/删除等局部操作）
 *
 *   中性（暖灰，取代原冷灰）  #fffaf6 页面底  #fff6ee 卡片底  #fdf3ea 表头
 *                     #e6d8ca 边框  #efe3d7 分隔线
 *                     #2f2723 正文  #5c5148 / #6b5f56 / #7d6e63 次级文字
 *
 *   文字对比度：正文 14.6:1、主色 5.65:1、次级 6.2:1、辅助 4.9:1 —— 均满足
 *   WCAG 2.1 AA（正文 ≥4.5:1）。
 *
 *   注意：本文件之外的色值大量以行内 style 形式写在 PHP 中，逐字面量对齐上表。
 *   请勿在此改用 var() 变量后再把变量名带进 inc/pdf_renderer.php ——
 *   确认单 PDF 由 TCPDF 渲染，其 CSS 解析器不支持自定义属性，会导致 PDF 失色。
 * ========================================================================= */

/* ===========================================================================
 * 品牌令牌（2026-09-12 主题化改造）：原先写死的品牌色值收敛为 CSS 变量，
 * html[data-theme="…"] 覆盖令牌即可整体换色（主题块见文件末尾）。
 * 默认值＝校徽红现配色；语义色（成功绿/危险红/提示金）不随主题变化。
 * 注意：行内 style 中的品牌色同样已改为 var(--tz-*) 引用；
 *       确认单 PDF 由 TCPDF 独立渲染、不走本文件，不受主题影响。
 * =========================================================================== */
:root {
    --tz-primary: #c8231e;          /* 主色：标题/主按钮/链接/选中态 */
    --tz-primary-deep: #a81b16;     /* hover / 页头渐变暗端 */
    --tz-primary-bright: #c03a18;   /* 页头渐变亮端 */
    --tz-primary-050: #fdeceb;      /* 主色浅底 */
    --tz-primary-100: #f2b3ae;      /* 主色浅边框 */
    --tz-grad-header: linear-gradient(180deg, #a81b16 0%, #c03a18 100%);
    --tz-glow: rgba(200, 35, 30, 0.16);   /* 输入框焦点环 */
    --tz-header-shadow: rgba(168, 27, 22, 0.16);
    --tz-bg: #fffaf6;               /* 页面底 */
    --tz-bg-deep: #fff6ee;          /* 表头/统计卡底 */
    --tz-hover-bg: #fdf3ea;         /* 悬停浅底 */
    --tz-border: #e6d8ca;           /* 输入框/表格边框 */
    --tz-line: #efe3d7;             /* 分隔线 */
    --tz-text: #2f2723;             /* 正文 */
    --tz-text-2: #6b5f56;           /* 次级文字 */
    --tz-label: #4a3f38;            /* 表单标签 */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--tz-bg);
    color: var(--tz-text);
    line-height: 1.6;
    font-size: 15px;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 15px;
}

/* 后台页面加宽（电脑端使用，学生端不受影响）：覆盖 .container 的 720px 上限 */
.container-wide {
    max-width: 1280px;
}

.site-header {
    text-align: center;
    padding: 32px 12px 30px;
    background: var(--tz-grad-header);
    color: #fff;
    border-radius: 8px;
    margin-bottom: 24px;
    box-shadow: 0 3px 12px var(--tz-header-shadow);
}
.site-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 3px;
    font-family: "SimHei", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
}

.card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--tz-primary);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--tz-line);
}

.form-group {
    margin-bottom: 18px;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--tz-label);
}
.form-group label .required {
    color: #b8473c;
    margin-left: 2px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--tz-border);
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
    -webkit-appearance: none;
    appearance: none;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--tz-primary);
    box-shadow: 0 0 0 3px var(--tz-glow);
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235c5148' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.radio-group label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--tz-line);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: normal;
}
.radio-group label:hover {
    border-color: var(--tz-primary);
    background: var(--tz-hover-bg);
}
.radio-group input[type="radio"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.radio-group .radio-text {
    line-height: 1.5;
}

.phone-row {
    display: flex;
    gap: 10px;
    align-items: center;
}
.phone-row select {
    width: 90px;
    flex-shrink: 0;
}
.phone-row input {
    flex: 1;
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
}
.btn-primary {
    background: var(--tz-primary);
    color: #fff;
}
.btn-primary:hover { background: var(--tz-primary-deep); }
.btn-success {
    background: #1e7a45;
    color: #fff;
}
.btn-success:hover { background: #155c33; }
.btn-danger {
    background: #a4160f;
    color: #fff;
}
.btn-danger:hover { background: #7d0f0a; }
.btn-secondary {
    background: #6c757d;
    color: #fff;
}
.btn-secondary:hover { background: #545b62; }
.btn-warning {
    background: #e08a00;
    color: #fff;
}
.btn-block {
    display: block;
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.msg-error, .msg-success, .msg-info {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}
.msg-error { background: #fdecec; color: #b02a1e; border: 1px solid #f2b3ae; }
.msg-success { background: #e8f6ec; color: #1e7a45; border: 1px solid #a9d9b6; }
.msg-info { background: #fff4e0; color: #8a5200; border: 1px solid #f0d090; }

.nav-links {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
}
.nav-links a {
    color: var(--tz-primary);
    text-decoration: none;
}
.nav-links a:hover { text-decoration: underline; }

/* ICP备案号（隐藏的管理员入口，文字颜色贴近页面背景以保持低调） */
.icp-footer {
    text-align: center;
    margin-top: 18px;
    padding-bottom: 10px;
    font-size: 12px;
}
.icp-footer a {
    color: #ddd0c4;
    text-decoration: none;
}
.icp-footer a:hover {
    color: #b9a99a;
}

.banner {
    background: #fff5dc;
    border: 1px solid #e9a80c;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 15px;
    text-align: center;
}
.banner a {
    color: #7a5600;
    text-decoration: none;
    font-weight: 500;
}

/* 通用打印隐藏规则（确认单全部样式已移交 css/print.css） */
@media print {
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    body { background: #fff; }
    .no-print { display: none !important; }
    .banner { display: none !important; }  /* 广告 Banner 仅屏幕展示，绝不进打印稿 */
    .container { max-width: 100%; padding: 0; }
    .site-header { display: none; }
    .card { box-shadow: none; border: none; padding: 0; margin: 0; }
}

/* 管理后台表格 */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 10px;
}
.admin-table th, .admin-table td {
    border: 1px solid var(--tz-border);
    padding: 8px 10px;
    text-align: left;
}
.admin-table th {
    background: var(--tz-hover-bg);
    font-weight: 600;
}
.admin-table tr:nth-child(even) {
    background: var(--tz-bg);
}
.admin-table tr:hover {
    background: var(--tz-hover-bg);
}

/* 状态标签 */
.status-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}
.status-normal { background: #e8f6ec; color: #1e7a45; }
.status-printed { background: #fff2e2; color: #b04a00; }
.status-deleted { background: #fdecec; color: #b02a1e; }
.status-deleted-user { background: #fff2e2; color: #b04a00; border: 1px solid #f0b060; }
.status-deleted-admin { background: #fdecec; color: #b02a1e; border: 1px solid #f2b3ae; }

/* 注销历史提示（后台考生列表状态列内，展示该身份证号的历史注销痕迹） */
.history-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #b02a1e;
    line-height: 1.5;
    word-break: break-all;
}

/* 响应式 */
@media (max-width: 600px) {
    .container { padding: 10px; }
    .site-header h1 { font-size: 1.1rem; }
    .card { padding: 15px; }
    .phone-row { flex-direction: column; align-items: stretch; }
    .phone-row select { width: 100%; }
    .btn-group { flex-direction: column; }
    .admin-table { font-size: 12px; }
    .admin-table th, .admin-table td { padding: 6px; }
}

/* 小屏手机优化 */
@media (max-width: 380px) {
    body { font-size: 14px; }
    .site-header { padding: 15px 8px; }
    .site-header h1 { font-size: 1rem; }
    input, select, textarea { padding: 10px 12px; font-size: 14px; }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}
.stat-card {
    background: var(--tz-bg-deep);
    border-radius: 6px;
    padding: 15px;
    text-align: center;
}
.stat-card .num {
    font-size: 1.6rem;
    font-weight: bold;
    color: var(--tz-primary);
}
.stat-card .label {
    font-size: 13px;
    color: var(--tz-text-2);
    margin-top: 4px;
}

.filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
    align-items: center;
}
.filter-bar input, .filter-bar select {
    width: auto;
    min-width: 120px;
}

.page-info {
    text-align: center;
    margin: 15px 0;
    color: var(--tz-text-2);
    font-size: 14px;
}
.page-btns {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

/* 级联选择器样式 */
.cascade-select {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.cascade-select select {
    min-width: 100px;
    flex: 1;
}

.tabs {
    display: flex;
    border-bottom: 2px solid var(--tz-line);
    margin-bottom: 15px;
}
.tab {
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-weight: 500;
}
.tab.active {
    border-bottom-color: var(--tz-primary);
    color: var(--tz-primary);
}
.tab:hover {
    color: var(--tz-primary);
}

/* 迷你富文本编辑器 */
.mini-editor {
    border: 1px solid var(--tz-border);
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}
.mini-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 6px 8px;
    border-bottom: 1px solid var(--tz-line);
    background: var(--tz-hover-bg);
    align-items: center;
}
.mini-editor-toolbar button {
    min-width: 28px;
    height: 26px;
    padding: 0 7px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: var(--tz-text);
    line-height: 1;
}
.mini-editor-toolbar button:hover {
    background: var(--tz-line);
}
.mini-editor-toolbar .me-sep {
    width: 1px;
    height: 18px;
    background: var(--tz-border);
    margin: 0 4px;
}
.mini-editor-toolbar select {
    width: auto;
    min-width: 64px;
    height: 26px;
    padding: 2px 6px;
    font-size: 12px;
    background-position: right 4px center;
    padding-right: 16px;
}
.mini-editor-palette {
    display: none;
    flex-wrap: wrap;
    gap: 5px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--tz-line);
    background: #fff;
}
.mini-editor-swatch {
    display: inline-block;
    width: 22px;
    height: 22px;
    border: 1px solid #b5a496;
    border-radius: 3px;
    cursor: pointer;
}
.mini-editor-swatch:hover {
    border-color: var(--tz-primary);
}
.mini-editor-area {
    padding: 10px 12px;
    min-height: 120px;
    font-size: 15px;
    line-height: 1.6;
    outline: none;
    overflow-y: auto;
    background: #fff;
    word-break: break-word;
}
.mini-editor-area:empty:before {
    content: attr(data-placeholder);
    color: #8f8078;
}
/* 编辑区内标题按确认单实际效果显示，避免误导 */
.mini-editor-area h3 {
    font-size: 13px;
    margin: 6px 0;
}

/* 后台动态选项行（校区志愿/调剂意向） */
.opt-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin-bottom: 10px;
}
.opt-row .mini-editor {
    flex: 1;
}
.opt-row .mini-editor .mini-editor-area {
    min-height: 56px;
}
.opt-del {
    padding: 8px 14px !important;
    font-size: 13px !important;
    white-space: nowrap;
}

/* 志愿统计：饼状图布局 */
.pie-layout {
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
}
.pie-svg {
    width: 200px;
    height: 200px;
    flex-shrink: 0;
}
.pie-legend {
    flex: 1;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.pie-total {
    font-size: 15px;
    color: var(--tz-text);
    margin-bottom: 4px;
}
.pie-total strong {
    font-size: 20px;
    color: var(--tz-primary);
}
.pie-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--tz-label);
}
.pie-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}
.pie-label {
    min-width: 72px;
    font-weight: 500;
}
.pie-num {
    color: var(--tz-text-2);
    font-size: 13px;
}

/* ===========================================================================
 * 多主题配色（2026-09-12）：与门户共享 localStorage('site_theme')
 * 机制：html[data-theme="…"] 覆盖 --tz-* 令牌，只换颜色、不动布局。
 * 色彩依据：清华紫 #660874（清华大学标准色，PANTONE 268C）；
 *          师大墨绿（上海师范大学主体色）；西浦蓝 #010544（西交利物浦
 *          大学标准色）＋西浦紫 #CE57C1 辅助。
 * 语义色（成功绿/危险红/提示金）不参与换肤，四套主题下保持一致。
 * =========================================================================== */
html[data-theme="thu"] {
    --tz-primary: #660874;  --tz-primary-deep: #4d0957;  --tz-primary-bright: #7d2187;
    --tz-primary-050: #f6eef8;  --tz-primary-100: #e3cbe9;
    --tz-grad-header: linear-gradient(180deg, #4d0957 0%, #7d2187 100%);
    --tz-glow: rgba(102, 8, 116, 0.16);
    --tz-header-shadow: rgba(77, 9, 87, 0.16);
    --tz-bg: #faf7fb;  --tz-bg-deep: #f4eef7;  --tz-hover-bg: #f6eef8;
    --tz-border: #e6dcee;  --tz-line: #efe7f3;
    --tz-text: #2b2430;  --tz-text-2: #64536d;  --tz-label: #574a60;
}
html[data-theme="shnu"] {
    --tz-primary: #1c5a49;  --tz-primary-deep: #144437;  --tz-primary-bright: #2a7a5f;
    --tz-primary-050: #e9f3ef;  --tz-primary-100: #c2d8ca;
    --tz-grad-header: linear-gradient(180deg, #144437 0%, #2a7a5f 100%);
    --tz-glow: rgba(28, 90, 73, 0.16);
    --tz-header-shadow: rgba(20, 68, 55, 0.16);
    --tz-bg: #f7faf8;  --tz-bg-deep: #eef5f0;  --tz-hover-bg: #e9f3ef;
    --tz-border: #dbe9df;  --tz-line: #e7f0ea;
    --tz-text: #24302b;  --tz-text-2: #57655e;  --tz-label: #3f4a45;
}
html[data-theme="xjtlu"] {
    --tz-primary: #12227d;  --tz-primary-deep: #010544;  --tz-primary-bright: #28409f;
    --tz-primary-050: #eceefb;  --tz-primary-100: #c6cce0;
    --tz-grad-header: linear-gradient(180deg, #010544 0%, #28409f 100%);
    --tz-glow: rgba(18, 34, 125, 0.16);
    --tz-header-shadow: rgba(1, 5, 68, 0.18);
    --tz-bg: #f7f8fc;  --tz-bg-deep: #eef0f8;  --tz-hover-bg: #eceefb;
    --tz-border: #dfe2ee;  --tz-line: #e9ebf5;
    --tz-text: #232635;  --tz-text-2: #585e75;  --tz-label: #434a63;
}

/* ---- 配色选择器（页头右上角，深色渐变底上以白描边呈现）---- */
.site-header { position: relative; }
.theme-switch {
    position: absolute;
    top: 10px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 7px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.12);
}
.theme-dot {
    width: 14px;
    height: 14px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--dot, var(--tz-primary));
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
}
.theme-dot:hover { transform: scale(1.15); }
.theme-dot.is-on { box-shadow: 0 0 0 2px #ffe08a; }
@media (max-width: 380px) {
    .theme-switch { top: 6px; right: 8px; }
    .theme-dot { width: 12px; height: 12px; }
}
