/* ============================================
 * 智慧学习网 - 全局样式
 * 使用 float / inline-block / table 布局
 * 兼容老设备, 不使用 flexbox / grid
 * ============================================ */

/* ===== 重置与基础样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "微软雅黑", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f6fa;
    min-width: 320px;
}

a {
    color: #1a73e8;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    border: 0;
}

/* ===== 通用工具类 ===== */
.clearfix:after {
    content: "";
    display: block;
    clear: both;
    height: 0;
    visibility: hidden;
}

.container {
    width: 96%;
    max-width: 1200px;
    margin: 0 auto;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.float-left { float: left; }
.float-right { float: right; }

/* ===== 配置警告横幅 ===== */
.config-warning {
    background-color: #fff3cd;
    border-bottom: 2px solid #ffc107;
    color: #856404;
    padding: 10px 20px;
    text-align: center;
    font-size: 14px;
}

.config-warning code {
    background-color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #ddd;
}

/* ===== 顶部导航栏 ===== */
.header {
    background-color: #1a73e8;
    color: #fff;
    height: 56px;
    line-height: 56px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    position: relative;
    z-index: 100;
}

.header .container {
    position: relative;
}

.header-logo {
    float: left;
    font-size: 20px;
    font-weight: bold;
    color: #fff;
}

.header-logo:hover {
    text-decoration: none;
}

.header-nav {
    float: right;
}

.header-nav ul li {
    float: left;
    margin-left: 8px;
}

.header-nav ul li a {
    display: inline-block;
    padding: 0 16px;
    color: #fff;
    font-size: 15px;
    line-height: 56px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.header-nav ul li a:hover {
    background-color: rgba(255,255,255,0.15);
    text-decoration: none;
}

.header-nav ul li a.active {
    background-color: rgba(255,255,255,0.2);
}

/* ===== 主内容区 ===== */
.main-content {
    padding: 20px 0;
    min-height: 400px;
}

.page-title {
    font-size: 22px;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #1a73e8;
}

/* ===== 筛选栏 ===== */
.filter-bar {
    background-color: #fff;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.filter-row {
    display: table;
    width: 100%;
}

.filter-item {
    display: table-cell;
    padding-right: 12px;
    vertical-align: middle;
}

.filter-item:last-child {
    padding-right: 0;
}

.filter-item label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}

.filter-item select,
.filter-item input {
    width: 100%;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
    color: #333;
}

.filter-item select:focus,
.filter-item input:focus {
    border-color: #1a73e8;
    outline: none;
}

.filter-btn {
    height: 36px;
    padding: 0 20px;
    line-height: 36px;
}

/* ===== 按钮 ===== */
.btn {
    display: inline-block;
    padding: 8px 20px;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    vertical-align: middle;
    background-color: #fff;
    color: #333;
    transition: all 0.2s;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background-color: #1a73e8;
    border-color: #1a73e8;
    color: #fff;
}

.btn-primary:hover {
    background-color: #1557b0;
    border-color: #1557b0;
}

.btn-success {
    background-color: #27ae60;
    border-color: #27ae60;
    color: #fff;
}

.btn-success:hover {
    background-color: #1e8449;
}

.btn-danger {
    background-color: #e74c3c;
    border-color: #e74c3c;
    color: #fff;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-warning {
    background-color: #f39c12;
    border-color: #f39c12;
    color: #fff;
}

.btn-warning:hover {
    background-color: #d68910;
}

.btn-default {
    background-color: #fff;
    border-color: #ddd;
    color: #333;
}

.btn-default:hover {
    background-color: #f5f5f5;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 13px;
}

.btn-lg {
    padding: 12px 28px;
    font-size: 16px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ===== 试卷卡片列表 ===== */
.paper-list {
    margin: 0 -10px;
}

.paper-card {
    float: left;
    width: 31.33%;
    margin: 0 1% 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.paper-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.paper-card-header {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.paper-title {
    display: inline-block;
    width: 70%;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.paper-title:hover {
    color: #1a73e8;
}

.paper-subject-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    color: #fff;
    font-size: 12px;
    font-weight: normal;
    vertical-align: middle;
    float: right;
    margin-top: 2px;
}

.paper-card-body {
    padding: 12px 16px;
}

.paper-info-row {
    margin-bottom: 6px;
    font-size: 13px;
    color: #666;
}

.paper-info-label {
    display: inline-block;
    width: 50px;
    color: #999;
}

.paper-info-value {
    color: #555;
}

.star {
    font-size: 14px;
    letter-spacing: 2px;
}

.paper-card-footer {
    padding: 10px 16px;
    border-top: 1px solid #f0f0f0;
    background-color: #fafafa;
}

.paper-download-count {
    font-size: 12px;
    color: #999;
    line-height: 30px;
}

/* ===== 表单样式 ===== */
.form-container {
    background-color: #fff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    max-width: 600px;
    margin: 0 auto;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: #333;
    font-weight: bold;
}

.form-group label .required {
    color: #e74c3c;
    margin-left: 2px;
}

.form-control {
    display: block;
    width: 100%;
    height: 38px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    background-color: #fff;
}

textarea.form-control {
    height: auto;
    min-height: 80px;
    resize: vertical;
}

.form-control:focus {
    border-color: #1a73e8;
    outline: none;
}

.form-hint {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.form-actions {
    text-align: center;
    margin-top: 24px;
}

/* ===== 提示框 ===== */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
    display: none;
}

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

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

.alert-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

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

/* ===== 上传说明区 ===== */
.upload-guide {
    background-color: #e8f0fe;
    border: 1px solid #c5d9f5;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.upload-guide h3 {
    font-size: 16px;
    color: #1a73e8;
    margin-bottom: 10px;
}

.upload-guide ol {
    padding-left: 20px;
    list-style: decimal;
    color: #555;
}

.upload-guide ol li {
    margin-bottom: 6px;
    line-height: 1.8;
}

.upload-guide .guide-link {
    color: #1a73e8;
    font-weight: bold;
}

/* ===== 空状态和加载状态 ===== */
.empty-state,
.loading-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.loading-spinner {
    font-size: 36px;
    margin-bottom: 10px;
}

/* ===== 管理后台 ===== */
.stats-row {
    display: table;
    width: 100%;
    margin-bottom: 24px;
    table-layout: fixed;
}

.stat-card {
    display: table-cell;
    width: 33.33%;
    padding: 0 8px;
}

.stat-card-inner {
    background-color: #fff;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-top: 3px solid #1a73e8;
}

.stat-card-inner.stat-pending {
    border-top-color: #f39c12;
}

.stat-card-inner.stat-approved {
    border-top-color: #27ae60;
}

.stat-card-inner.stat-total {
    border-top-color: #1a73e8;
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: #999;
}

/* ===== 管理后台表格 ===== */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.admin-table th,
.admin-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}

.admin-table th {
    background-color: #fafafa;
    font-weight: bold;
    color: #555;
    white-space: nowrap;
}

.admin-table tr:hover {
    background-color: #f9f9f9;
}

.admin-table .col-actions {
    white-space: nowrap;
}

.admin-table .col-actions .btn {
    margin-right: 4px;
}

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    color: #fff;
}

/* ===== 标签页 ===== */
.tabs {
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.tabs ul {
    display: table;
    width: 100%;
}

.tabs ul li {
    display: table-cell;
    text-align: center;
}

.tabs ul li a {
    display: block;
    padding: 12px 20px;
    font-size: 15px;
    color: #666;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.tabs ul li a:hover {
    text-decoration: none;
    color: #1a73e8;
}

.tabs ul li a.active {
    color: #1a73e8;
    border-bottom-color: #1a73e8;
    font-weight: bold;
}

/* ===== 详情页 ===== */
.detail-container {
    background-color: #fff;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.detail-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.detail-title {
    font-size: 24px;
    color: #333;
    margin-bottom: 10px;
}

.detail-tags {
    margin-top: 8px;
}

.detail-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 13px;
    color: #fff;
    margin-right: 6px;
    margin-bottom: 4px;
}

.detail-info-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}

.detail-info-table th,
.detail-info-table td {
    padding: 12px 16px;
    border: 1px solid #eee;
    font-size: 14px;
}

.detail-info-table th {
    background-color: #fafafa;
    color: #666;
    font-weight: normal;
    width: 120px;
    text-align: right;
}

.detail-info-table td {
    color: #333;
}

.detail-download {
    text-align: center;
    padding: 24px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin-top: 20px;
}

.detail-download p {
    color: #666;
    margin-bottom: 16px;
    font-size: 14px;
}

/* ===== 登录页 ===== */
.login-container {
    max-width: 400px;
    margin: 40px auto;
    background-color: #fff;
    border-radius: 8px;
    padding: 36px 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.login-title {
    text-align: center;
    font-size: 22px;
    color: #333;
    margin-bottom: 28px;
}

/* ===== 底部页脚 ===== */
.footer {
    background-color: #2c3e50;
    color: #bdc3c7;
    padding: 24px 0;
    text-align: center;
    font-size: 13px;
    margin-top: 40px;
}

.footer p {
    margin-bottom: 4px;
}

.footer a {
    color: #3498db;
}

/* ===== 响应式适配 (多断点, 兼容手机/平板/桌面) ===== */

/* --- 大屏桌面 (>1024px): 3列卡片 --- */

/* --- 平板横屏 / 小桌面 (768px ~ 1024px): 2列卡片 --- */
@media screen and (max-width: 1024px) {
    .paper-card {
        width: 48%;
    }

    .container {
        width: 94%;
    }
}

/* --- 平板竖屏 (600px ~ 768px): 2列卡片, 简化布局 --- */
@media screen and (max-width: 768px) {
    .header {
        height: auto;
        line-height: normal;
        padding: 8px 0;
    }

    .header .container {
        position: static;
    }

    .header-logo {
        float: none;
        display: block;
        text-align: center;
        font-size: 18px;
        padding: 4px 0;
    }

    .header-nav {
        float: none;
        text-align: center;
    }

    .header-nav ul {
        display: inline-block;
    }

    .header-nav ul li {
        float: none;
        display: inline-block;
        margin-left: 0;
        margin-right: 4px;
    }

    .header-nav ul li a {
        line-height: 40px;
        padding: 0 12px;
        font-size: 14px;
    }

    .paper-card {
        width: 48%;
    }

    .filter-item {
        display: block;
        padding-right: 0;
        margin-bottom: 10px;
    }

    .filter-item:last-child {
        text-align: center;
    }

    .stat-card {
        display: block;
        width: 100%;
        margin-bottom: 12px;
        padding: 0;
    }

    .stat-card-inner {
        padding: 16px;
    }

    .stat-number {
        font-size: 26px;
    }

    .tabs ul {
        display: block;
    }

    .tabs ul li {
        display: inline-block;
        width: 49%;
    }

    .tabs ul li a {
        padding: 10px 12px;
        font-size: 14px;
    }

    .admin-table {
        font-size: 12px;
    }

    .admin-table th,
    .admin-table td {
        padding: 8px 6px;
    }

    .page-title {
        font-size: 18px;
    }

    .form-container {
        padding: 20px;
    }

    .detail-container {
        padding: 20px;
    }

    .detail-title {
        font-size: 20px;
    }

    .detail-info-table th {
        width: 90px;
    }
}

/* --- 大手机 (480px ~ 600px): 单列卡片 --- */
@media screen and (max-width: 600px) {
    .paper-card {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .paper-list {
        margin: 0;
    }

    .filter-bar {
        padding: 12px;
    }

    .upload-guide {
        padding: 14px;
    }

    .upload-guide ol {
        padding-left: 16px;
    }

    .stats-row {
        margin-bottom: 16px;
    }
}

/* --- 小手机 (360px ~ 480px): 紧凑布局 --- */
@media screen and (max-width: 480px) {
    body {
        font-size: 13px;
    }

    .container {
        width: 92%;
    }

    .header-logo {
        font-size: 16px;
    }

    .header-nav ul li {
        margin-right: 2px;
    }

    .header-nav ul li a {
        padding: 0 8px;
        font-size: 13px;
    }

    .form-container,
    .detail-container {
        padding: 14px;
        border-radius: 6px;
    }

    .login-container {
        padding: 24px 18px;
        margin: 20px auto;
    }

    .login-title {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .paper-card {
        border-radius: 6px;
    }

    .paper-card-header {
        padding: 12px;
    }

    .paper-card-body {
        padding: 10px 12px;
    }

    .paper-card-footer {
        padding: 8px 12px;
    }

    .paper-title {
        font-size: 15px;
        width: 65%;
    }

    .paper-subject-tag {
        font-size: 11px;
        padding: 2px 6px;
    }

    .btn {
        padding: 6px 16px;
        font-size: 13px;
    }

    .btn-sm {
        padding: 4px 10px;
        font-size: 12px;
    }

    .btn-lg {
        padding: 10px 24px;
        font-size: 15px;
    }

    .page-title {
        font-size: 16px;
        margin-bottom: 14px;
    }

    .detail-title {
        font-size: 18px;
    }

    .detail-info-table th,
    .detail-info-table td {
        padding: 8px 10px;
        font-size: 13px;
    }

    .detail-info-table th {
        width: 80px;
    }

    .admin-table {
        font-size: 11px;
    }

    .admin-table th,
    .admin-table td {
        padding: 6px 4px;
    }

    .admin-table .col-actions .btn {
        padding: 3px 6px;
        font-size: 11px;
        margin-right: 2px;
    }

    .stat-number {
        font-size: 22px;
    }

    .stat-label {
        font-size: 12px;
    }

    .tabs ul li a {
        padding: 8px 6px;
        font-size: 13px;
    }

    .footer {
        padding: 16px 0;
        font-size: 12px;
    }
}

/* --- 超小手机 (<360px): 最紧凑布局 --- */
@media screen and (max-width: 360px) {
    .container {
        width: 90%;
    }

    .header-logo {
        font-size: 14px;
    }

    .header-nav ul li a {
        padding: 0 6px;
        font-size: 12px;
    }

    .paper-title {
        font-size: 14px;
        width: 60%;
    }

    .form-container,
    .detail-container {
        padding: 10px;
    }

    .admin-table {
        font-size: 10px;
    }

    .admin-table th,
    .admin-table td {
        padding: 4px 3px;
    }
}

/* --- 触摸设备优化: 增大点击区域 --- */
@media screen and (max-width: 768px) and (pointer: coarse) {
    .btn,
    .header-nav ul li a,
    .paper-card,
    .tabs ul li a {
        min-height: 40px;
    }

    .form-control {
        height: 42px;
        font-size: 15px;
    }

    .filter-item select,
    .filter-item input {
        height: 40px;
        font-size: 15px;
    }
}
