/* ================================================================
   人才申报系统 — 全局样式
   主题色：紫色(品牌) / 绿色(错别字) / 橙色(润色)
   ================================================================ */

/* ── CSS 变量 ─────────────────────────────────────────────── */
:root {
    --purple:        #6d28d9;
    --purple-light:  #ede9fe;
    --purple-dark:   #4c1d95;
    --green:         #059669;
    --green-light:   #d1fae5;
    --green-dark:    #047857;
    --orange:        #d97706;
    --orange-light:  #fef3c7;
    --orange-dark:   #b45309;

    --bg:            #f3f4f6;
    --white:         #ffffff;
    --text:          #1f2937;
    --text-gray:     #6b7280;
    --border:        #e5e7eb;
    --shadow:        0 2px 8px rgba(0,0,0,0.08);
    --radius:        10px;
    --font:          "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
}

/* ── 基础重置 ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--text); background: var(--bg); min-height: 100vh; }
a { color: var(--purple); text-decoration: none; }
input, button { font-family: inherit; }

/* ── 按钮 ─────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 22px; border: none; border-radius: var(--radius);
    font-size: 14px; font-weight: 600; cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
}
.btn:hover { opacity: 0.9; }
.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--purple); color: #fff; }
.btn-green   { background: var(--green); color: #fff; }
.btn-orange  { background: var(--orange); color: #fff; }
.btn-dark-green  { background: var(--green-dark); color: #fff; }
.btn-dark-orange { background: var(--orange-dark); color: #fff; }
.btn-outline { background: var(--white); color: var(--text); border: 1px solid var(--border); }
.btn-full    { width: 100%; }
.btn-sm      { padding: 5px 12px; font-size: 12px; }
.btn-lg      { padding: 14px 32px; font-size: 16px; }

/* ── 登录页 ───────────────────────────────────────────────── */
.login-page {
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #4c1d95 0%, #7c3aed 40%, #c084fc 70%, #db2777 100%);
    min-height: 100vh;
}

.login-card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    padding: 44px 40px 36px;
    width: 400px;
    max-width: 94vw;
}

.login-header {
    display: flex; align-items: center; gap: 10px; margin-bottom: 6px;
}
.login-icon {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 8px;
    background: var(--purple); color: #fff; font-size: 18px;
}
.login-title { font-size: 22px; color: var(--purple); font-weight: 700; }
.login-subtitle { font-size: 13px; color: var(--text-gray); margin-bottom: 28px; }

.login-form .form-group { margin-bottom: 18px; }
.login-form label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--text); }
.login-form input {
    width: 100%; padding: 10px 14px; border: 1px solid var(--border);
    border-radius: var(--radius); font-size: 14px; outline: none;
    transition: border 0.2s;
}
.login-form input:focus { border-color: var(--purple); }

.login-hint { text-align: center; font-size: 12px; color: var(--text-gray); margin-top: 16px; }
.login-error { text-align: center; color: #dc2626; font-size: 13px; margin-top: 8px; }

/* ── 布局（主页）───────────────────────────────────────────── */
.app-layout { display: flex; flex-direction: column; height: 100vh; }

/* 顶部条 */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    height: 56px; padding: 0 20px;
    background: var(--white); border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.topbar-brand { display: flex; align-items: center; gap: 8px; }
.topbar-icon {
    display: flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; border-radius: 6px;
    background: var(--purple); color: #fff; font-size: 14px;
}
.topbar-title { font-size: 16px; font-weight: 700; color: var(--purple); }
.topbar-menu {
    width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
    font-size: 20px; cursor: pointer; border-radius: 6px; color: var(--text);
}
.topbar-menu:hover { background: var(--bg); }

/* 主区域 */
.main-area { display: flex; flex: 1; overflow: hidden; }

/* 侧边栏 */
.sidebar {
    width: 200px; background: var(--white); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; flex-shrink: 0;
}
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 20px; font-size: 14px; color: var(--text);
    cursor: pointer; border-left: 3px solid transparent;
    transition: background 0.15s, border-color 0.15s;
}
.nav-item:hover { background: var(--bg); }
.nav-item.active {
    background: var(--purple-light); color: var(--purple);
    border-left-color: var(--purple); font-weight: 600;
}
.nav-item .nav-icon { font-size: 16px; width: 20px; text-align: center; }
.nav-spacer { flex: 1; }
.nav-logout {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 20px; font-size: 14px; color: var(--text-gray);
    cursor: pointer; border-top: 1px solid var(--border);
}
.nav-logout:hover { color: #dc2626; }

/* 内容区 */
.content {
    flex: 1; overflow-y: auto; padding: 28px 32px;
    background: var(--bg);
}

/* 页面卡片 */
.page-card {
    background: var(--white); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 28px 32px; max-width: 960px;
}

/* ── 首页工作台 ──────────────────────────────────────────── */
.page-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.page-subtitle { font-size: 13px; color: var(--text-gray); margin-bottom: 24px; }

/* 上传区域 */
.upload-section { margin-bottom: 20px; }
.upload-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.file-info { display: none; align-items: center; gap: 8px; font-size: 13px; color: var(--text-gray); }
.file-info.show { display: flex; }
.file-info .file-name { color: var(--text); font-weight: 600; }
.file-info a { cursor: pointer; font-size: 12px; color: var(--purple); }
.file-info a:hover { text-decoration: underline; }

/* 功能卡片（错别字 + 润色） */
.feature-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.feature-card {
    background: var(--white); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px;
    display: flex; gap: 14px; align-items: flex-start;
    cursor: pointer; transition: border-color 0.2s, box-shadow 0.2s;
}
.feature-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.feature-card.selected-typo  { border-color: var(--green);  box-shadow: 0 0 0 2px var(--green-light); }
.feature-card.selected-polish { border-color: var(--orange); box-shadow: 0 0 0 2px var(--orange-light); }

.card-icon {
    width: 44px; height: 44px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: #fff; flex-shrink: 0;
}
.card-icon.green  { background: var(--green); }
.card-icon.orange { background: var(--orange); }

.card-body h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.card-body p { font-size: 12px; color: var(--text-gray); line-height: 1.6; }

/* ── 操作按钮行 ──────────────────────────────────────────── */
.action-row { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }

/* ── 进度条 ──────────────────────────────────────────────── */
.progress-section { display: none; margin-bottom: 20px; }
.progress-section.show { display: block; }
.progress-header { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.progress-text { color: var(--text-gray); }
.progress-pct { color: var(--green); font-weight: 600; }
.progress-bar {
    height: 8px; background: #e5e7eb; border-radius: 4px; overflow: hidden;
}
.progress-fill {
    height: 100%; background: var(--green); border-radius: 4px;
    transition: width 0.3s; width: 0%;
}

/* ── 润色一级模式 tab ────────────────────────────────────── */
.polish-tabs {
    display: none; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px;
}
.polish-tabs.show { display: grid; }
.polish-tab {
    padding: 14px; border: 1px solid #fde68a; border-radius: var(--radius);
    background: #fffbeb; font-size: 14px; font-weight: 600; color: var(--text);
    cursor: pointer; text-align: center; transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.polish-tab:hover { border-color: var(--orange); }
.polish-tab.active { background: var(--orange); color: #fff; border-color: var(--orange); }

/* ── 润色文体选择面板 ────────────────────────────────────── */
.style-panel {
    display: none; background: #fffbeb; border: 1px solid #fde68a;
    border-radius: var(--radius); padding: 20px 24px; margin-bottom: 20px;
}
.style-panel.show { display: block; }
.style-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.style-panel-title { font-size: 15px; font-weight: 600; }
.polish-mode-badge {
    font-size: 11px; color: var(--orange); background: var(--white);
    border: 1px solid #fde68a; border-radius: 999px; padding: 3px 10px;
}
.style-panel-desc { font-size: 12px; color: var(--text-gray); margin-bottom: 14px; }
.style-panel-subtitle { font-size: 12px; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.style-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.style-btn {
    padding: 10px 16px; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--white); font-size: 13px; cursor: pointer; text-align: center;
    transition: border-color 0.2s, background 0.2s;
}
.style-btn:hover { border-color: var(--orange); }
.style-btn.selected {
    background: var(--orange); color: #fff; border-color: var(--orange); font-weight: 600;
}
.style-panel-hint { font-size: 11px; color: var(--text-gray); }

/* ── 结果区域 ─────────────────────────────────────────────── */
.result-section { display: none; }
.result-section.show { display: block; }

.result-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
}
.result-title { font-size: 15px; font-weight: 600; }
.result-export {
    display: flex; align-items: center; gap: 4px; font-size: 12px;
    color: var(--purple); cursor: pointer;
}

/* 表格 */
.data-table {
    width: 100%; border-collapse: collapse; font-size: 13px;
}
.data-table th {
    text-align: left; padding: 10px 14px; background: #f9fafb;
    border-bottom: 2px solid var(--border); font-weight: 600; color: var(--text-gray);
}
.data-table td {
    padding: 10px 14px; border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.data-table tr:hover td { background: #fafafa; }
.cell-wrong { color: #dc2626; font-weight: 600; }
.cell-correct { color: var(--green); font-weight: 600; }
.cell-context { color: var(--text); }
.cell-reason { color: var(--text-gray); font-size: 12px; }

/* 润色结果 */
.polish-changes { margin-bottom: 20px; }
.polish-change-item {
    background: #fefce8; border-left: 3px solid var(--orange);
    padding: 12px 16px; margin-bottom: 10px; border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 13px;
}
.polish-change-item .change-original { color: var(--text-gray); text-decoration: line-through; }
.polish-change-item .change-revised { color: var(--orange-dark); font-weight: 600; }
.polish-change-item .change-reason { color: var(--text-gray); font-size: 12px; margin-top: 4px; }

/* 润色文本对比 */
.text-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.text-compare-box {
    border: 1px solid var(--border); border-radius: var(--radius); padding: 16px;
    background: #fafafa; max-height: 400px; overflow-y: auto;
}
.text-compare-box h4 { font-size: 13px; color: var(--text-gray); margin-bottom: 8px; }
.text-compare-box .text-content { font-size: 13px; line-height: 1.8; white-space: pre-wrap; }

/* ── 历史记录页 ──────────────────────────────────────────── */
.history-page { display: none; }
.history-page.show { display: block; }

.history-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.history-table th {
    text-align: left; padding: 10px 14px; background: #f9fafb;
    border-bottom: 2px solid var(--border); font-weight: 600;
}
.history-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.history-table tr:hover td { background: #fafafa; }
.badge {
    display: inline-block; padding: 2px 10px; border-radius: 12px;
    font-size: 11px; font-weight: 600;
}
.badge-typo   { background: var(--green-light); color: var(--green-dark); }
.badge-polish { background: var(--orange-light); color: var(--orange-dark); }

/* ── 系统配置页 ──────────────────────────────────────────── */
.config-form {
    max-width: 560px;
}
.config-form .form-group {
    margin-bottom: 20px;
}
.config-form label {
    display: block; font-size: 13px; font-weight: 600;
    margin-bottom: 5px; color: var(--text);
}
.config-form input {
    width: 100%; padding: 10px 14px; border: 1px solid var(--border);
    border-radius: var(--radius); font-size: 14px; outline: none;
    font-family: "Consolas", "Courier New", monospace;
    transition: border 0.2s;
}
.config-form input:focus { border-color: var(--purple); }
.form-hint {
    display: block; margin-top: 4px; font-size: 11px; color: var(--text-gray);
}
.config-actions {
    display: flex; gap: 12px; margin-top: 24px;
}
.config-feedback {
    margin-top: 16px; padding: 12px 16px; border-radius: var(--radius);
    font-size: 13px; line-height: 1.6;
}
.config-feedback.success {
    background: var(--green-light); color: var(--green-dark);
    border: 1px solid #a7f3d0;
}
.config-feedback.error {
    background: #fee2e2; color: #991b1b;
    border: 1px solid #fecaca;
}
.config-feedback.testing {
    background: var(--purple-light); color: var(--purple-dark);
    border: 1px solid #c4b5fd;
}

/* ── 工具提示 / 空状态 ───────────────────────────────────── */
.empty-state { text-align: center; padding: 40px; color: var(--text-gray); font-size: 14px; }
.hidden { display: none !important; }

/* ── 分页 ─────────────────────────────────────────────────── */
.pagination { display: flex; justify-content: flex-end; gap: 6px; margin-top: 16px; font-size: 13px; color: var(--text-gray); }

/* ── 响应式 ──────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .feature-cards { grid-template-columns: 1fr; }
    .style-buttons { grid-template-columns: repeat(2, 1fr); }
    .content { padding: 16px; }
    .page-card { padding: 20px 16px; }
}
