/* 繼承 General_subject.css 的基礎樣式 */
@import url('General_subject.css');

:root {
    --war-room-bg: #f0f2f5;
    --war-room-card-bg: #ffffff;
    --war-room-primary: #2c3e50;
    --war-room-accent: #3498db;
    --war-room-accent-hover: #2980b9;
    --war-room-text: #2c3e50;
    --war-room-text-muted: #7f8c8d;
    --war-room-border: #ecf0f1;
    --war-room-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --war-room-shadow-hover: 0 8px 15px rgba(0, 0, 0, 0.1);
}

body {
    background-color: var(--war-room-bg);
    color: var(--war-room-text);
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

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

/* 頂部導航與標題 */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    background: var(--war-room-card-bg);
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: var(--war-room-shadow);
}

.page-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-title h1 {
    margin: 0;
    font-size: 1.8rem;
    color: var(--war-room-primary);
    font-weight: 700;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--war-room-text-muted);
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: #f8f9fa;
    border: 1px solid var(--war-room-border);
}

.back-btn:hover {
    background: var(--war-room-accent);
    color: white;
    border-color: var(--war-room-accent);
    transform: translateX(-3px);
}

/* 統計儀表板 */
.stats-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--war-room-card-bg);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--war-room-shadow);
    border: 1px solid var(--war-room-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--war-room-accent);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--war-room-shadow-hover);
}

.stat-number {
    font-size: 2.8em;
    font-weight: 800;
    color: var(--war-room-primary);
    margin: 10px 0;
    line-height: 1;
}

.stat-label {
    color: var(--war-room-text-muted);
    font-size: 0.95em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 輸入區塊 */
.input-section {
    background: var(--war-room-card-bg);
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--war-room-shadow);
    margin-bottom: 30px;
    border: 1px solid var(--war-room-border);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f2f5;
}

.section-header h2 {
    margin: 0;
    font-size: 1.4rem;
    color: var(--war-room-primary);
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.9em;
    font-weight: 600;
    color: var(--war-room-text);
    margin-left: 4px;
}

input[type="text"],
input[type="number"],
select {
    padding: 12px 15px;
    border: 2px solid var(--war-room-border);
    border-radius: 10px;
    font-size: 1rem;
    width: 100%;
    transition: all 0.2s ease;
    background: #fcfcfc;
    color: var(--war-room-text);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--war-room-accent);
    background: white;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* 按鈕樣式 */
.btn-add {
    background: linear-gradient(135deg, var(--war-room-accent), #2980b9);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 48px;
    /* Match input height */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 6px rgba(52, 152, 219, 0.2);
}

.btn-add:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(52, 152, 219, 0.3);
}

/* 科目統計卡片網格 */
.subject-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.subject-stat-card {
    background: var(--war-room-card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--war-room-shadow);
    border: 1px solid var(--war-room-border);
    border-left: 5px solid var(--war-room-accent);
    transition: transform 0.2s ease;
}

.subject-stat-card:hover {
    transform: translateY(-3px);
}

.subject-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.subject-stat-header h3 {
    margin: 0;
    font-size: 1.15em;
    color: var(--war-room-primary);
    font-weight: 700;
}

.subject-total-count {
    font-size: 0.8em;
    color: white;
    background: var(--war-room-text-muted);
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 0.95em;
}

.stat-row .stat-label {
    color: #666;
}

.stat-row .stat-value {
    font-weight: 700;
    color: var(--war-room-primary);
    font-family: 'Roboto Mono', monospace;
}

.stat-value.stat-good {
    color: #27ae60;
}

.stat-value.stat-bad {
    color: #c0392b;
}

/* 記錄列表 */
.display-section {
    background: var(--war-room-card-bg);
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--war-room-shadow);
    border: 1px solid var(--war-room-border);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 15px;
}

th {
    background: #f8f9fa;
    color: var(--war-room-text-muted);
    font-weight: 600;
    padding: 15px;
    text-align: left;
    border-bottom: 2px solid var(--war-room-border);
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.5px;
}

td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    color: var(--war-room-text);
    vertical-align: middle;
}

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

tr:hover td {
    background-color: #f8f9fa;
}

/* 分數徽章 */
.score-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.9em;
    min-width: 60px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.score-high {
    background-color: #e8f8f5;
    color: #27ae60;
    border: 1px solid #d4efdf;
}

.score-medium {
    background-color: #fef9e7;
    color: #f39c12;
    border: 1px solid #fdebd0;
}

.score-low {
    background-color: #fdedec;
    color: #c0392b;
    border: 1px solid #fadbd8;
}

/* 危險區域 */
.danger-zone {
    margin-top: 40px;
    padding: 25px;
    background: #fff5f5;
    border: 1px solid #ffebeb;
    border-radius: 12px;
}

.danger-zone h3 {
    color: #c0392b;
    margin-top: 0;
}

.btn-clear {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-clear:hover {
    background: #c0392b;
}

.btn-clear:disabled {
    background: #e6b0aa;
    cursor: not-allowed;
}

/* 響應式調整 */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .back-btn {
        width: 100%;
        justify-content: center;
    }

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

    .btn-add {
        width: 100%;
    }
}

/* 平板尺寸调整 */
@media (max-width: 1024px) and (min-width: 769px) {
    .input-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}