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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f9f0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.app-container {
    width: 1100px;
    max-width: 92vw;
    height: 92vh;
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0,40,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.app-container.wide {
    width: 1400px;
    max-width: 95vw;
}

header {
    background: #1a7a2e;
    color: white;
    padding: 20px 24px;
    text-align: center;
    border-bottom: 3px solid #ffcd3c;
    position: relative;
}
header h1 { font-size: 1.8rem; margin-bottom: 4px; letter-spacing: 1px; }
header p { opacity: 0.9; font-size: 0.9rem; }
.header-toolbar {
    position: absolute;
    top: 14px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
}
header .header-link {
    color: white;
    text-decoration: underline;
    margin: 0 8px;
}
header .header-user {
    margin: 0 8px;
    font-weight: bold;
}

/* ---------- 登录页 ---------- */
.login-container { justify-content: flex-start; }
.login-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.login-form {
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.login-form label { color: #4a6741; font-size: 0.85rem; margin-top: 8px; }
.login-form input {
    padding: 10px 12px;
    border: 1px solid #cbd5c1;
    border-radius: 8px;
    font-size: 0.95rem;
}
.login-form input:focus { outline: none; border-color: #2d9c3e; }
.login-form .audit-btn { margin-top: 16px; }
.login-error { color: #b91c1c; font-size: 0.9rem; margin-top: 8px; }

/* ---------- 历史记录列表页 ---------- */
.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
}
.history-table th, .history-table td {
    text-align: left;
    padding: 16px 18px;
    border-bottom: 1px solid #e5e7eb;
}
.history-table th { color: #1a5c2a; background: #eef3ea; }
.history-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 20px;
}
.history-pager button:disabled { background: #cbd5c1; cursor: not-allowed; }
#pageInfo { color: #4a6741; font-size: 0.9rem; }

.audit-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fefef7;
    overflow-y: auto;
    padding: 36px;
}

/* ---------- 上传区域 ---------- */
.upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.upload-box {
    width: 100%;
    max-width: 420px;
    border: 2px dashed #cbd5c1;
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.upload-box:hover {
    border-color: #2d9c3e;
    background: #f4f8f2;
}
.upload-icon { font-size: 2.5rem; margin-bottom: 8px; }
.upload-box p { color: #4a6741; margin: 4px 0; }
.upload-hint { font-size: 0.8rem; color: #8a9a82; }

.selected-file {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #eef3ea;
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 0.9rem;
    color: #1a5c2a;
}
.selected-file button {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 0.7rem;
    line-height: 1;
}

.audit-btn {
    padding: 10px 32px;
    border-radius: 24px;
    border: none;
    background: #2d9c3e;
    color: white;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}
.audit-btn:hover { background: #248c34; }
.audit-btn:disabled {
    background: #cbd5c1;
    cursor: not-allowed;
}

/* ---------- 进度区域 ---------- */
.progress-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2f0e2;
    border-top-color: #2d9c3e;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
#progressText { color: #4a6741; }

/* ---------- 报告区域 ---------- */
.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.report-header h3 { color: #1a5c2a; font-size: 1.1rem; }
.new-audit-btn {
    padding: 6px 16px;
    border-radius: 18px;
    border: 1px solid #cde0cd;
    background: #eef3ea;
    color: #2d6a2f;
    cursor: pointer;
    font-size: 0.85rem;
}
.new-audit-btn:hover { background: #e2f0e2; }
.danger-btn {
    border-color: #e0b4b4;
    background: #fbeaea;
    color: #b33a3a;
    margin-left: 6px;
}
.danger-btn:hover { background: #f6d6d6; }

.report-summary {
    background: #e8f5e8;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    border-left: 4px solid #2d9c3e;
    color: #1e4620;
    font-size: 0.9rem;
}

.issue-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.issue-card {
    background: #f8faf5;
    border-radius: 12px;
    padding: 14px 16px;
    border-left: 4px solid #94a3b8;
}
.issue-card.severity-high { border-left-color: #ef4444; background: #fef2f2; }
.issue-card.severity-medium { border-left-color: #f5a623; background: #fff7ed; }
.issue-card.severity-low { border-left-color: #94a3b8; background: #f8faf5; }

.issue-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.issue-category, .issue-severity {
    display: inline-block;
    font-size: 0.75rem;
    padding: 2px 10px;
    border-radius: 10px;
    font-weight: 500;
}
.issue-category { background: #e2f0e2; color: #1a5c2a; }
.issue-severity.severity-high { background: #fee2e2; color: #b91c1c; }
.issue-severity.severity-medium { background: #fef3c7; color: #92400e; }
.issue-severity.severity-low { background: #e5e7eb; color: #4b5563; }

.issue-quote {
    font-size: 0.85rem;
    color: #6b7280;
    background: white;
    border-radius: 8px;
    padding: 8px 10px;
    margin: 6px 0;
    border: 1px solid #e5e7eb;
}
.issue-text { font-size: 0.9rem; color: #1f2937; margin: 4px 0; }
.issue-suggestion {
    font-size: 0.85rem;
    color: #1a5c2a;
    margin-top: 4px;
}
.issue-suggestion strong { color: #166534; }

.no-issues {
    text-align: center;
    color: #4a6741;
    padding: 20px;
}

/* ---------- 错误区域 ---------- */
.error-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}
#errorText { color: #b91c1c; font-size: 0.95rem; }
