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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 8px;
}

header h1 {
    font-size: 28px;
    margin-bottom: 8px;
}

header .subtitle {
    font-size: 14px;
    opacity: 0.9;
}

.header-actions {
    margin-top: 12px;
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

.cmd-palette-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.cmd-palette-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.cmd-palette-btn kbd {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
}

/* Cmd+K 命令面板 */
.cmd-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 100px;
}

.cmd-dialog {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.cmd-dialog input {
    width: 100%;
    padding: 16px 20px;
    border: none;
    border-bottom: 1px solid #eee;
    font-size: 16px;
    outline: none;
}

.cmd-results {
    max-height: 400px;
    overflow-y: auto;
}

.cmd-section {
    padding: 8px 0;
}

.cmd-section-title {
    padding: 4px 20px;
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cmd-item {
    padding: 10px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #333;
    transition: background 0.1s;
}

.cmd-item:hover {
    background: #f0f4ff;
}

.cmd-item i {
    color: #667eea;
    width: 18px;
}

.cmd-empty {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

.back-link {
    position: absolute;
    top: 30px;
    right: 30px;
    color: white;
    text-decoration: none;
    font-size: 14px;
}

.card {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.card h2 {
    font-size: 20px;
    margin-bottom: 16px;
    color: #2c3e50;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="month"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.btn {
    padding: 10px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.tab {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.result-box {
    margin-top: 16px;
    padding: 16px;
    border-radius: 4px;
    background: #f8f9fa;
}

.result-box.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.result-box.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.result-box.warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.kpi-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.kpi-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.kpi-card .label {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.kpi-card .value {
    font-size: 28px;
    font-weight: bold;
}

.kpi-card .trend {
    font-size: 12px;
    margin-top: 4px;
}

.kpi-card .trend.up {
    color: #4ade80;
}

.kpi-card .trend.down {
    color: #f87171;
}

.decision-table {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
}

table td {
    padding: 12px;
    border-bottom: 1px solid #dee2e6;
}

table tr:hover {
    background: #f8f9fa;
}

.light {
    font-size: 20px;
}

.confidence {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.confidence.high {
    background: #d4edda;
    color: #155724;
}

.confidence.medium {
    background: #fff3cd;
    color: #856404;
}

.confidence.low {
    background: #f8d7da;
    color: #721c24;
}

.filters {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filters input,
.filters select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.search-box input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.bottom-nav {
    text-align: center;
    padding: 20px;
}

.nav-link {
    display: inline-block;
    padding: 12px 24px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
}

.nav-link:hover {
    background: #5568d3;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

.error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 8px;
}

.success-message {
    color: #28a745;
    font-size: 14px;
    margin-top: 8px;
}

.hint {
    color: #888;
    font-size: 12px;
    display: block;
    margin-top: 4px;
}

.logout-link {
    display: inline-block;
    margin-top: 12px;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background 0.2s;
}

.logout-link:hover {
    background: rgba(255, 255, 255, 0.3);
}
