/* ===== 重置 & 基础变量 ===== */
:root {
    --navy-900: #0a1628;
    --navy-800: #0f2137;
    --navy-700: #162d4a;
    --navy-600: #1e3a5f;
    --navy-500: #2d4a6f;
    
    --gold-500: #c9a962;
    --gold-400: #d4b978;
    --gold-600: #b8964f;
    --gold-100: #faf6eb;
    
    --ink-900: #0d1117;
    --ink-800: #161b22;
    --ink-700: #21262d;
    --ink-600: #30363d;
    --ink-500: #484f58;
    --ink-400: #6e7681;
    --ink-300: #8b949e;
    --ink-200: #b1bac4;
    --ink-100: #d0d7de;
    --ink-50: #e6edf3;
    --ink-25: #f0f3f6;
    --ink-10: #f6f8fa;
    
    --paper: #fafaf7;
    --paper-2: #f4f4f0;
    --paper-3: #ebebe5;
    
    --success: #2d8a5e;
    --danger: #b4443a;
    --warning: #b8761e;
    --primary: #1e3a5f;
    
    --font-serif: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', 'SimSun', serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

/* ===== 全局基础 ===== */
body {
    background: var(--paper);
    color: var(--ink-800);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    line-height: 1.7;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--navy-900), var(--gold-500), var(--navy-900));
    z-index: 9999;
}

/* ===== 登录页面 ===== */
.login-page {
    background: var(--paper);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    display: none;
}

.login-page::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 45%;
    height: 100%;
    background: linear-gradient(180deg, var(--navy-800) 0%, var(--navy-900) 100%);
    z-index: 0;
}

.login-page::before {
    display: block;
    content: '';
    position: absolute;
    top: 50%;
    right: 22.5%;
    transform: translate(50%, -50%);
    width: 300px;
    height: 300px;
    border: 1px solid rgba(201, 169, 98, 0.15);
    border-radius: 50%;
    z-index: 0;
    animation: pulse-ring 4s ease-in-out infinite;
}

@keyframes pulse-ring {
    0%, 100% { transform: translate(50%, -50%) scale(1); opacity: 0.5; }
    50% { transform: translate(50%, -50%) scale(1.1); opacity: 0.8; }
}

.login-container {
    position: relative;
    z-index: 2;
    background: #ffffff;
    border: 1px solid var(--ink-25);
    border-radius: 2px;
    padding: 48px 40px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.06);
    max-width: 400px;
    margin-right: 55%;
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-container:hover {
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 12px 32px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}

.login-container {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-header {
    margin-bottom: 32px;
    text-align: left;
}

.logo {
    width: 40px;
    height: 40px;
    margin: 0 0 20px 0;
    background: var(--navy-800);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-400);
    position: relative;
}

.logo::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 20px;
    height: 2px;
    background: var(--gold-500);
}

.login-header h1 {
    font-size: 22px;
    font-weight: 600;
    color: var(--ink-900);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
    font-family: var(--font-serif);
}

.login-header p {
    font-size: 13px;
    color: var(--ink-400);
}

/* ===== 表单元素 ===== */
.login-form .input-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-500);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.login-form input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--ink-100);
    border-radius: 2px;
    font-size: 14px;
    color: var(--ink-800);
    background: #ffffff;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    font-family: inherit;
}

.login-form input:focus {
    border-color: var(--navy-600);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.08);
}

.login-form input::placeholder {
    color: var(--ink-300);
}

/* ===== 按钮 ===== */
.btn-primary {
    width: 100%;
    padding: 12px 20px;
    background: var(--navy-800);
    color: #ffffff;
    border: 1px solid var(--navy-800);
    border-radius: 2px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    background: var(--navy-700);
    border-color: var(--navy-700);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(15, 33, 55, 0.2);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(15, 33, 55, 0.15);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    padding: 12px 20px;
    font-size: 14px;
    background: #ffffff;
    color: var(--ink-700);
    border: 1px solid var(--ink-100);
    border-radius: 2px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

.btn-secondary:hover {
    background: var(--ink-10);
    border-color: var(--ink-200);
    color: var(--ink-800);
    transform: translateY(-1px);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== 加载状态 ===== */
.btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-loading::before {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--gold-400);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== 错误提示 ===== */
.error-message {
    color: var(--danger);
    font-size: 13px;
    margin-top: 16px;
    text-align: left;
    min-height: 18px;
    padding-left: 4px;
    border-left: 2px solid var(--danger);
    padding-left: 10px;
}

/* ===== 主页面头部 ===== */
.main-header {
    background: #ffffff;
    border-bottom: 1px solid var(--ink-25);
    padding: 0 32px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: none;
    box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-small {
    width: 32px;
    height: 32px;
    background: var(--navy-800);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-400);
    transition: all 0.2s ease;
}

.logo-small:hover {
    transform: scale(1.05);
    background: var(--navy-700);
}

.header-left h1 {
    font-size: 16px;
    font-weight: 600;
    color: var(--ink-900);
    letter-spacing: 0.02em;
    font-family: var(--font-serif);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.remaining-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--gold-100);
    border: 1px solid rgba(201, 169, 98, 0.3);
    padding: 6px 14px;
    border-radius: 2px;
    transition: all 0.2s ease;
}

.remaining-badge:hover {
    border-color: var(--gold-500);
}

.remaining-label {
    font-size: 12px;
    color: var(--ink-500);
}

.remaining-count {
    font-size: 14px;
    font-weight: 600;
    color: var(--gold-600);
    font-variant-numeric: tabular-nums;
}

.btn-icon {
    width: 34px;
    height: 34px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-400);
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--ink-10);
    color: var(--ink-700);
    border-color: var(--ink-25);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    padding-left: 12px;
    border-left: 1px solid var(--ink-25);
}

.user-info span {
    color: var(--ink-700);
    font-weight: 500;
}

.user-info a {
    color: var(--ink-400);
    text-decoration: none;
    font-size: 12px;
    transition: color 0.2s ease;
}

.user-info a:hover {
    color: var(--navy-600);
}

.admin-link {
    color: var(--gold-600) !important;
    font-weight: 500;
}

/* ===== 主内容区 ===== */
.main-content {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px;
}

/* ===== 面板 ===== */
.panel {
    background: #ffffff;
    border: 1px solid var(--ink-25);
    border-radius: 2px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.panel::before {
    display: none;
}

.panel::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--gold-500);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.panel:hover {
    border-color: var(--ink-100);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.06);
    transform: translateY(-1px);
}

.panel:hover::after {
    transform: scaleY(1);
}

.panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--ink-25);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
}

.panel:hover .panel-header {
    background: var(--ink-10);
}

.panel-header h2 {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-800);
    letter-spacing: 0.02em;
    font-family: var(--font-serif);
}

.char-count {
    font-size: 12px;
    color: var(--ink-400);
    font-variant-numeric: tabular-nums;
    font-family: var(--font-mono);
}

.char-count span:first-child {
    color: var(--ink-500);
    font-weight: 500;
}

.panel-body {
    padding: 20px;
}

/* ===== 文本域 ===== */
#contentInput {
    width: 100%;
    min-height: 180px;
    padding: 14px 16px;
    border: 1px solid var(--ink-100);
    border-radius: 2px;
    font-size: 14px;
    line-height: 1.8;
    resize: vertical;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
    color: var(--ink-800);
    background: #ffffff;
}

#contentInput:focus {
    border-color: var(--navy-600);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.08);
}

#contentInput::placeholder {
    color: var(--ink-300);
}

/* ===== 选项区 ===== */
.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.option-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.option-item label {
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.option-item select {
    padding: 9px 12px;
    border: 1px solid var(--ink-100);
    border-radius: 2px;
    font-size: 13px;
    background: #ffffff;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
    color: var(--ink-800);
    height: 38px;
}

.option-item select:focus {
    border-color: var(--navy-600);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.08);
}

.checkbox-item {
    justify-content: flex-end;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--ink-600);
    transition: color 0.2s ease;
}

.checkbox-label:hover {
    color: var(--ink-800);
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--navy-600);
}

/* ===== 分隔线 ===== */
.options-divider {
    position: relative;
    margin: 24px 0 20px;
    text-align: center;
}

.options-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--ink-25);
}

.divider-text {
    position: relative;
    background: #ffffff;
    padding: 0 16px;
    font-size: 11px;
    font-weight: 500;
    color: var(--ink-400);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    z-index: 1;
}

/* ===== 操作按钮 ===== */
.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.action-buttons .btn-primary,
.action-buttons .btn-secondary {
    flex: 1;
}

.btn-large {
    padding: 13px 24px;
    font-size: 14px;
}

/* ===== 结果状态 ===== */
.result-status {
    padding: 5px 12px;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid transparent;
    letter-spacing: 0.02em;
    transition: all 0.2s ease;
}

.result-status.pass {
    background: #f0f7f3;
    color: var(--success);
    border-color: #c8e0d0;
}

.result-status.fail {
    background: #fdf2f1;
    color: var(--danger);
    border-color: #f0ccca;
}

.result-status:hover {
    transform: scale(1.02);
}

/* ===== 统计摘要 ===== */
.result-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.summary-item {
    background: var(--ink-10);
    border: 1px solid var(--ink-25);
    border-radius: 2px;
    padding: 18px 16px;
    text-align: left;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.summary-item::before {
    display: none;
}

.summary-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--navy-600);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.summary-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    border-color: var(--ink-100);
}

.summary-item:hover::after {
    transform: scaleX(1);
}

.summary-item.top-risk {
    background: #fdf2f1;
    border-color: #f0ccca;
}

.summary-item.top-risk::after {
    background: var(--danger);
}

.summary-item.low-risk {
    background: #fef8ee;
    border-color: #e9d5a7;
}

.summary-item.low-risk::after {
    background: var(--warning);
}

.summary-label {
    display: block;
    font-size: 12px;
    color: var(--ink-400);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.summary-count {
    display: block;
    font-size: 28px;
    font-weight: 700;
    color: var(--ink-800);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    font-family: var(--font-serif);
    transition: transform 0.3s ease;
}

.summary-item:hover .summary-count {
    transform: scale(1.05);
}

.top-risk .summary-count {
    color: var(--danger);
}

.low-risk .summary-count {
    color: var(--warning);
}

.summary-words {
    display: block;
    font-size: 11px;
    color: var(--ink-400);
    margin-top: 6px;
    line-height: 1.5;
    word-break: break-all;
}

/* ===== 结果内容 ===== */
.result-content {
    margin-bottom: 24px;
}

.result-content h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-700);
    margin-bottom: 12px;
    font-family: var(--font-serif);
    padding-left: 10px;
    border-left: 3px solid var(--gold-500);
}

.highlight-content {
    padding: 16px 18px;
    background: var(--ink-10);
    border: 1px solid var(--ink-25);
    border-radius: 2px;
    font-size: 13px;
    line-height: 1.9;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--ink-700);
    transition: all 0.3s ease;
}

.jwy-topRisk {
    color: var(--danger);
    background: #fdf2f1;
    padding: 1px 5px;
    border-radius: 2px;
    font-weight: 500;
    border-bottom: 1px solid #e5a39d;
    transition: all 0.15s ease;
}

.jwy-lowRisk {
    color: var(--warning);
    background: #fef8ee;
    padding: 1px 5px;
    border-radius: 2px;
    font-weight: 500;
    border-bottom: 1px solid #d9bd84;
    transition: all 0.15s ease;
}

.jwy-topRisk:hover,
.jwy-lowRisk:hover {
    filter: brightness(1.05);
}

/* ===== 风险列表 ===== */
.risk-list-container h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-700);
    margin-bottom: 12px;
    font-family: var(--font-serif);
    padding-left: 10px;
    border-left: 3px solid var(--gold-500);
}

.risk-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.risk-item {
    border: 1px solid var(--ink-25);
    border-radius: 2px;
    padding: 14px 16px;
    transition: all 0.2s ease;
    background: #ffffff;
    position: relative;
    overflow: hidden;
}

.risk-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--danger);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.risk-item:hover {
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-color: var(--ink-100);
}

.risk-item:hover::before {
    transform: scaleY(1);
}

.risk-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.risk-word {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-800);
    font-family: var(--font-serif);
}

.risk-type {
    padding: 3px 8px;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid transparent;
    letter-spacing: 0.02em;
    transition: all 0.2s ease;
}

.risk-type.top {
    background: #fdf2f1;
    color: var(--danger);
    border-color: #f0ccca;
}

.risk-type.low {
    background: #fef8ee;
    color: var(--warning);
    border-color: #e9d5a7;
}

.risk-type:hover {
    transform: scale(1.05);
}

.risk-source {
    font-size: 11px;
    color: var(--ink-400);
    margin-left: auto;
    font-family: var(--font-mono);
}

.risk-item:hover .risk-source {
    color: var(--ink-500);
}

.risk-reason {
    font-size: 13px;
    color: var(--ink-500);
    margin-bottom: 10px;
    line-height: 1.6;
}

.risk-suggestion-tip {
    font-size: 12px;
    color: var(--navy-600);
    background: #eef2f7;
    border: 1px solid #c8d3e0;
    border-radius: 2px;
    padding: 8px 12px;
    line-height: 1.6;
}

/* ===== 模态框 ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(13, 17, 23, 0.6);
    backdrop-filter: blur(2px);
    animation: fadeIn 0.2s ease;
}

.modal-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(13, 17, 23, 0.6);
    z-index: 1;
}

.modal-content {
    position: relative;
    z-index: 2;
    background: #ffffff;
    border: 1px solid var(--ink-100);
    border-radius: 2px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 460px;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--ink-25);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
}

.modal-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--ink-800);
    letter-spacing: 0.02em;
    font-family: var(--font-serif);
}

.btn-close {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-400);
    border-radius: 2px;
    transition: all 0.2s ease;
}

.btn-close:hover {
    background: var(--ink-10);
    color: var(--ink-700);
}

.modal-body {
    padding: 22px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-600);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--ink-100);
    border-radius: 2px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
    color: var(--ink-800);
    background: #ffffff;
    height: 38px;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--navy-600);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.08);
}

.form-group input::placeholder {
    color: var(--ink-300);
}

.form-hint {
    margin-top: 14px;
    padding: 12px 14px;
    background: var(--ink-10);
    border: 1px solid var(--ink-25);
    border-radius: 2px;
    font-size: 12px;
    color: var(--ink-500);
    line-height: 1.7;
}

.form-hint a {
    color: var(--navy-600);
    text-decoration: none;
}

.form-hint a:hover {
    text-decoration: underline;
}

.modal-footer {
    padding: 16px 22px;
    border-top: 1px solid var(--ink-25);
    display: flex;
    justify-content: flex-end;
    background: var(--ink-10);
}

.modal-footer .btn-primary {
    width: auto;
    padding: 8px 20px;
    font-size: 13px;
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background: var(--ink-800);
    color: #ffffff;
    border-radius: 2px;
    font-size: 13px;
    z-index: 2000;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    border-left: 3px solid var(--gold-500);
    animation: toastIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.toast.success,
.toast.toast-success {
    background: #1e5638;
    border-left-color: var(--success);
}

.toast.error,
.toast.toast-error {
    background: #7a2d26;
    border-left-color: var(--danger);
}

/* ===== 进度条 ===== */
.rewrite-progress-container {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--ink-25);
}

.rewrite-progress-container h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-700);
    margin-bottom: 12px;
    font-family: var(--font-serif);
}

.rewrite-progress {
    background: var(--ink-10);
    border: 1px solid var(--ink-25);
    border-radius: 2px;
    padding: 16px;
    margin-bottom: 12px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--ink-25);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: var(--navy-700);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--ink-500);
}

.progress-info span:first-child {
    color: var(--ink-600);
    font-weight: 500;
}

.progress-round {
    font-size: 12px;
    color: var(--ink-400);
    font-family: var(--font-mono);
}

.rewrite-log {
    max-height: 180px;
    overflow-y: auto;
    font-size: 12px;
    line-height: 1.7;
    border: 1px solid var(--ink-25);
    border-radius: 2px;
    padding: 6px;
    background: #ffffff;
}

.log-item {
    padding: 6px 10px;
    border-radius: 2px;
    margin-bottom: 2px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    transition: all 0.2s ease;
}

.log-item:hover {
    transform: translateX(2px);
}

.log-item.info {
    background: #eef2f7;
    color: var(--navy-600);
}

.log-item.success {
    background: #f0f7f3;
    color: var(--success);
}

.log-item.error {
    background: #fdf2f1;
    color: var(--danger);
}

.log-item.warning {
    background: #fef8ee;
    color: var(--warning);
}

/* ===== 改写结果 ===== */
.rewrite-result-container {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--ink-25);
}

.rewrite-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.rewrite-result-header h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-700);
    font-family: var(--font-serif);
    padding-left: 10px;
    border-left: 3px solid var(--gold-500);
}

.rewrite-result-actions {
    display: flex;
    gap: 8px;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    font-size: 12px;
    background: #ffffff;
    color: var(--ink-600);
    border: 1px solid var(--ink-100);
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-outline:hover {
    border-color: var(--navy-600);
    color: var(--navy-600);
    background: #eef2f7;
    transform: translateY(-1px);
}

.rewrite-content {
    padding: 16px 18px;
    background: #f0f7f3;
    border: 1px solid #c8e0d0;
    border-radius: 2px;
    font-size: 13px;
    line-height: 1.9;
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--ink-700);
}

/* ===== 认证页面 ===== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: var(--paper);
    position: relative;
    overflow-y: auto;
    padding: 40px 0;
}

.auth-page::before {
    display: none;
}

.auth-page::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 45%;
    height: 100%;
    background: linear-gradient(180deg, var(--navy-800) 0%, var(--navy-900) 100%);
    z-index: 0;
}

.auth-container {
    width: 100%;
    max-width: 440px;
    padding: 24px;
    position: relative;
    z-index: 2;
    margin-left: 45%;
}

.auth-card {
    background: #ffffff;
    border: 1px solid var(--ink-25);
    border-radius: 2px;
    padding: 36px 32px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.06);
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transition: all 0.3s ease;
}

.auth-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 12px 32px rgba(0,0,0,0.08);
}

.auth-header {
    text-align: left;
    margin-bottom: 28px;
}

.auth-logo-bar {
    width: 32px;
    height: 3px;
    background: var(--gold-500);
    margin: 0 0 20px 0;
    border-radius: 1px;
}

.auth-header h1 {
    font-size: 22px;
    font-weight: 600;
    color: var(--ink-900);
    margin-bottom: 8px;
    font-family: var(--font-serif);
    letter-spacing: 0.02em;
}

.auth-header p {
    font-size: 13px;
    color: var(--ink-400);
}

.auth-footer {
    margin-top: 20px;
    text-align: left;
    font-size: 13px;
    color: var(--ink-400);
}

.auth-footer a {
    color: var(--navy-600);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* ===== 管理后台 ===== */
.admin-layout {
    display: flex;
    min-height: 100vh;
    background: var(--paper);
}

.admin-sidebar {
    width: 220px;
    background: var(--navy-900);
    padding: 0;
    flex-shrink: 0;
    position: relative;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
}

.admin-sidebar h2 {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 8px;
    font-family: var(--font-serif);
    letter-spacing: 0.05em;
    background: var(--navy-800);
    -webkit-text-fill-color: #ffffff;
}

.admin-menu {
    list-style: none;
    padding: 8px 0;
}

.admin-menu li a {
    display: block;
    padding: 10px 24px;
    color: var(--ink-300);
    text-decoration: none;
    font-size: 13px;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    position: relative;
}

.admin-menu li a::before {
    display: none;
}

.admin-menu li a:hover,
.admin-menu li a.active {
    background: rgba(255,255,255,0.05);
    color: #ffffff;
    border-left-color: var(--gold-500);
}

.admin-menu li a.active {
    font-weight: 500;
    background: rgba(255,255,255,0.08);
}

.admin-main {
    flex: 1;
    padding: 28px 32px;
    overflow: auto;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--ink-25);
}

.admin-header h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--ink-900);
    flex-shrink: 0;
    white-space: nowrap;
    font-family: var(--font-serif);
    letter-spacing: 0.02em;
}

.admin-header .btn-primary {
    width: auto;
    min-width: 120px;
    height: 36px;
    padding: 0 24px;
    font-size: 13px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.admin-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid var(--ink-25);
    border-radius: 2px;
}

.admin-toolbar input,
.admin-toolbar select {
    height: 34px;
    padding: 0 12px;
    font-size: 13px;
    border: 1px solid var(--ink-100);
    border-radius: 2px;
    background: #ffffff;
    color: var(--ink-800);
    outline: none;
    transition: all 0.2s ease;
}

.admin-toolbar input:focus,
.admin-toolbar select:focus {
    border-color: var(--navy-600);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.08);
}

/* ===== 表格 ===== */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border: 1px solid var(--ink-25);
    border-radius: 2px;
    overflow: hidden;
    font-size: 13px;
}

.admin-table th {
    background: var(--ink-10);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--ink-600);
    border-bottom: 1px solid var(--ink-25);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
}

.admin-table th::after {
    display: none;
}

.admin-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--ink-25);
    color: var(--ink-700);
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tbody tr {
    transition: all 0.15s ease;
}

.admin-table tbody tr:hover {
    background: var(--ink-10);
    transform: none;
}

.admin-table tbody tr:hover td {
    background: transparent;
}

/* ===== 分页 ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.pagination button {
    padding: 6px 14px;
    font-size: 12px;
    border: 1px solid var(--ink-100);
    background: #ffffff;
    color: var(--ink-600);
    border-radius: 2px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}

.pagination button:hover:not(:disabled) {
    background: var(--navy-700);
    color: white;
    border-color: var(--navy-700);
    transform: translateY(-1px);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination span {
    font-size: 12px;
    color: var(--ink-400);
}

/* ===== Badge ===== */
.badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 11px;
    border-radius: 2px;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: all 0.2s ease;
}

.badge:hover {
    transform: scale(1.05);
}

.badge-success { background: #f0f7f3; color: var(--success); border: 1px solid #c8e0d0; }
.badge-danger { background: #fdf2f1; color: var(--danger); border: 1px solid #f0ccca; }
.badge-warning { background: #fef8ee; color: var(--warning); border: 1px solid #e9d5a7; }
.badge-default { background: var(--ink-10); color: var(--ink-600); border: 1px solid var(--ink-100); }
.badge-primary { background: #eef2f7; color: var(--navy-600); border: 1px solid #c8d3e0; }

/* ===== 配置区 ===== */
.config-section {
    margin-bottom: 0;
}

.config-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-700);
    margin-bottom: 14px;
    letter-spacing: 0.02em;
    font-family: var(--font-serif);
    position: relative;
    padding-left: 0;
}

.config-title::before {
    display: none;
}

.config-divider {
    height: 1px;
    background: var(--ink-25);
    margin: 24px 0;
}

/* ===== 操作链接 ===== */
.action-link {
    color: var(--navy-600);
    text-decoration: none;
    font-size: 12px;
    margin-right: 10px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    position: relative;
    transition: color 0.2s ease;
}

.action-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: currentColor;
    transition: width 0.2s ease;
}

.action-link:hover::after {
    width: 100%;
}

.action-link:hover {
    text-decoration: none;
    color: var(--navy-700);
}

.action-link.danger { color: var(--danger); }

/* ===== 批量添加 ===== */
.batch-add-textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    font-size: 13px;
    border: 1px solid var(--ink-100);
    border-radius: 2px;
    font-family: inherit;
    resize: vertical;
    background: #ffffff;
    color: var(--ink-800);
    outline: none;
    transition: all 0.2s ease;
}

.batch-add-textarea:focus {
    border-color: var(--navy-600);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.08);
}

.batch-add-hint {
    font-size: 12px;
    color: var(--ink-400);
    margin-top: 8px;
}

/* ===== 通用动画 ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-16px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-fadeIn {
    animation: fadeIn 0.3s ease forwards;
}

.animate-scaleIn {
    animation: modalIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.count-animated {
    display: inline-block;
    animation: fadeInUp 0.5s ease-out;
}

/* ===== 响应式 ===== */
@media (max-width: 640px) {
    .main-header {
        padding: 0 16px;
        height: 52px;
    }

    .header-left h1 {
        font-size: 14px;
    }

    .main-content {
        padding: 16px;
    }

    .result-summary {
        grid-template-columns: 1fr;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }

    .login-container {
        padding: 32px 24px;
        margin-right: 0;
    }

    .login-page::after {
        display: none;
    }

    .action-buttons {
        flex-direction: column;
    }

    .rewrite-result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .rewrite-result-actions {
        width: 100%;
    }

    .btn-outline {
        flex: 1;
        justify-content: center;
    }
    
    .auth-container {
        margin-left: 0;
    }
    
    .auth-page::after {
        display: none;
    }
    
    .admin-sidebar {
        width: 180px;
    }
    
    .admin-main {
        padding: 16px;
    }
}

/* ===== 修复表格表头文字换行问题 ===== */
.admin-table th {
    white-space: nowrap;
    text-transform: none;
    letter-spacing: 0;
}

/* ===== 确保toast正确显示 ===== */
.toast {
    width: auto;
    min-width: 120px;
}

/* ===== 工具类 ===== */
.hidden {
    display: none !important;
}

/* ===== 修复顶部装饰条 ===== */
body::before {
    height: 3px;
}

/* ===== 修复概览卡片文字竖排 ===== */
.result-summary .summary-item {
    text-align: center;
    min-width: 90px;
}

.result-summary .summary-item .summary-label {
    white-space: nowrap;
    writing-mode: horizontal-tb;
    text-align: center;
    display: block;
}

.result-summary .summary-item .summary-count {
    text-align: center;
    display: block;
}

/* ===== 修复表格内标签 ===== */
.admin-table .badge {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: auto;
    padding: 4px 10px;
}

/* ===== 修复表格单元格文字换行 ===== */
.admin-table th,
.admin-table td {
    white-space: nowrap;
}

/* ===== 确保表格有合理宽度 ===== */
.admin-table {
    width: 100%;
    table-layout: auto;
}

/* ===== 侧边栏底部操作区 ===== */
.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    background: var(--navy-900);
}

.sidebar-footer .sidebar-btn {
    display: block;
    width: 100%;
    padding: 10px 16px;
    margin-bottom: 8px;
    text-align: center;
    text-decoration: none;
    font-size: 13px;
    border-radius: 2px;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
    background: transparent;
    font-family: inherit;
    box-sizing: border-box;
}

.sidebar-footer .sidebar-btn:last-child {
    margin-bottom: 0;
}

.sidebar-footer .sidebar-btn-back {
    color: var(--gold-400);
    border-color: rgba(201, 169, 98, 0.3);
}

.sidebar-footer .sidebar-btn-back:hover {
    background: rgba(201, 169, 98, 0.1);
    border-color: var(--gold-500);
    color: var(--gold-300);
}

.sidebar-footer .sidebar-btn-logout {
    color: var(--ink-400);
    border-color: rgba(255,255,255,0.1);
}

.sidebar-footer .sidebar-btn-logout:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.2);
    color: #ffffff;
}
