* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    background: #f5f7fb;
    color: #333;
}

.container { max-width: 1100px; margin: 32px auto; padding: 0 16px; }
.small-container { max-width: 520px; }
.wide-container { max-width: 1700px; }

.card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    padding: 24px;
}

.mt12 { margin-top: 12px; }
.mt20 { margin-top: 20px; }

h1, h2, h3 { margin-top: 0; color: #1f3c88; }

.desc { color: #666; margin-bottom: 16px; }
.desc.small { font-size: 14px; }

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.full-width { grid-column: 1 / -1; }

.form-group { display: flex; flex-direction: column; }

label { margin-bottom: 8px; font-weight: 600; }
label span { color: #d93025; }

input, textarea, select {
    width: 100%;
    border: 1px solid #dcdfe6;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 15px;
    outline: none;
    background: #fff;
}

textarea { resize: vertical; }

input:focus, textarea:focus, select:focus {
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.12);
}

.help-text { margin-top: 6px; color: #777; font-size: 13px; }

.btn-group, .top-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.btn {
    display: inline-block;
    text-decoration: none;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 14px;
}

.btn-primary { background: #1f6feb; color: #fff; }
.btn-secondary { background: #e9eef7; color: #333; }
.btn-danger { background: #d93025; color: #fff; }
.btn-small { padding: 8px 12px; font-size: 13px; }

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert.success { background: #e7f6ec; color: #1e7e34; }
.alert.error { background: #fdeceb; color: #b3261e; }

.top-bar {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.user-badge {
    background: #eef4ff;
    color: #1f57c3;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: #f7faff;
    border: 1px solid #e3ebf7;
    border-radius: 12px;
    padding: 18px;
}

.stat-title { color: #666; font-size: 14px; margin-bottom: 10px; }
.stat-value { font-size: 24px; font-weight: 700; color: #1f3c88; }

.chart-card {
    background: #fbfcff;
    border: 1px solid #e7eef8;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 20px;
}

.chart-title { font-size: 16px; font-weight: 700; margin-bottom: 16px; color: #1f3c88; }

.svg-chart {
    height: 240px;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.bar-wrap {
    width: 90px;
    min-width: 90px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.bar-value { font-size: 12px; color: #666; margin-bottom: 6px; }

.bar {
    width: 48px;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(180deg, #4a90e2 0%, #1f6feb 100%);
    min-height: 4px;
}

.bar-label {
    font-size: 12px;
    color: #555;
    margin-top: 8px;
    text-align: center;
    word-break: break-word;
}

.filter-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-form input[type="text"] { flex: 1; min-width: 260px; }

.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1700px;
}

th, td {
    border: 1px solid #e5e7eb;
    padding: 12px;
    text-align: left;
    vertical-align: top;
    font-size: 14px;
}

th { background: #f2f5fa; font-weight: 700; }

.status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
}

.status-submitted { background: #fff4d6; color: #946200; }
.status-teacher_approved { background: #e8f0fe; color: #1f57c3; }
.status-teacher_rejected, .status-admin_rejected { background: #fdeceb; color: #b3261e; }
.status-admin_approved { background: #e7f6ec; color: #1e7e34; }
.status-admin_purchased { background: #e7f6ec; color: #0b6b3c; }

.review-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.review-cell {
    min-width: 260px;
    line-height: 1.7;
}

.empty {
    text-align: center;
    color: #999;
    padding: 30px 0;
}

.tips {
    margin-top: 20px;
    padding: 14px 16px;
    background: #f7faff;
    border-radius: 10px;
    color: #555;
    font-size: 14px;
    line-height: 1.8;
}

.admin-tool-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.tool-card {
    background: #fbfcff;
    border: 1px solid #e7eef8;
    border-radius: 12px;
    padding: 18px;
}

.subline {
    color: #666;
    margin-top: 4px;
}

@media (max-width: 900px) {
    .form-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .card { padding: 18px; }
}

@media (max-width: 600px) {
    .stats-grid { grid-template-columns: 1fr; }
}