/* assets/style.css - 统一卡片样式，全面兼容手机/电脑 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f0f2f5;
    color: #333;
    line-height: 1.6;
    padding: 12px;
    min-height: 100vh;
}

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

.card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    padding: 24px 20px;
    margin-bottom: 16px;
    transition: box-shadow 0.2s;
}

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

h1, h2, h3 {
    margin-top: 0;
    color: #1a1a2e;
    font-weight: 600;
}

h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }

/* 表单控件 */
input, select, textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fafafa;
    -webkit-appearance: none;
    appearance: none;
}

input:focus, select:focus, textarea:focus {
    border-color: #4a90d9;
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.2);
    background: #fff;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-decoration: none;
    color: #fff;
    text-align: center;
    touch-action: manipulation;
    min-height: 44px;
}

.btn:hover {
    transform: translateY(-1px);
}
.btn:active {
    transform: translateY(0);
}

.btn-primary { background: #4a90d9; }
.btn-primary:hover { background: #357abd; }

.btn-success { background: #28a745; }
.btn-success:hover { background: #218838; }

.btn-danger { background: #dc3545; }
.btn-danger:hover { background: #c82333; }

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

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    min-height: 34px;
}

.form-group {
    margin-bottom: 16px;
}
.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 5px;
    font-size: 14px;
}

/* 表格 - 移动端横向滚动 */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -4px;
    padding: 0 4px;
}

table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    min-width: 600px;
    font-size: 14px;
}

th, td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
    word-break: break-word;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #1a1a2e;
    white-space: nowrap;
}

tr:hover {
    background: #f5f7fa;
}

/* 消息提示 */
.flash {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}
.flash-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}
.flash-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

/* 分页 */
.pagination {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.pagination a {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    background: #f0f2f5;
    color: #333;
    text-decoration: none;
    transition: background 0.2s;
    font-size: 14px;
    min-width: 36px;
    text-align: center;
}
.pagination a:hover {
    background: #4a90d9;
    color: #fff;
}

/* 头部导航 - 单排 */
.header {
    background: #1a1a2e;
    color: #fff;
    padding: 12px 20px;
    border-radius: 12px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.header .brand {
    font-weight: 600;
    font-size: 16px;
}
.header .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
}
.header .nav-links a {
    color: #fff;
    text-decoration: none;
    opacity: 0.8;
    font-size: 14px;
    padding: 4px 0;
    transition: opacity 0.2s;
}
.header .nav-links a:hover {
    opacity: 1;
}

/* 工具类 */
.text-center { text-align: center; }
.text-muted { color: #888; font-size: 13px; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.w-full { width: 100%; }

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}
.stat-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}
.stat-card .number {
    font-size: 32px;
    font-weight: 700;
}
.stat-card .label {
    color: #888;
    font-size: 14px;
}
.stat-card.blue .number { color: #4a90d9; }
.stat-card.green .number { color: #28a745; }
.stat-card.red .number { color: #dc3545; }
.stat-card.gray .number { color: #6c757d; }

/* ========== 移动端适配 ========== */
@media (max-width: 768px) {
    body { padding: 8px; }
    .card { padding: 16px 14px; border-radius: 10px; margin-bottom: 12px; }
    h1 { font-size: 22px; }
    h2 { font-size: 18px; }
    h3 { font-size: 16px; }
    
    .header {
        padding: 10px 14px;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .header .brand { text-align: center; font-size: 15px; }
    .header .nav-links { justify-content: center; }
    .header .nav-links a {
        font-size: 13px;
        padding: 4px 10px;
        background: rgba(255,255,255,0.1);
        border-radius: 6px;
    }
    
    table { font-size: 13px; min-width: 500px; }
    th, td { padding: 8px 10px; }
    
    .btn { padding: 10px 16px; font-size: 14px; min-height: 40px; width: 100%; }
    .btn-sm { padding: 5px 12px; font-size: 12px; min-height: 32px; width: auto; }
    input, select, textarea { font-size: 16px; padding: 10px 12px; }
    .pagination a { padding: 5px 10px; font-size: 13px; min-width: 32px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-card .number { font-size: 24px; }
}

@media (max-width: 480px) {
    body { padding: 6px; }
    .card { padding: 12px 10px; border-radius: 8px; }
    h1 { font-size: 20px; }
    h2 { font-size: 16px; }
    h3 { font-size: 15px; }
    .header .nav-links a { font-size: 12px; padding: 3px 8px; }
    table { font-size: 12px; min-width: 400px; }
    th, td { padding: 6px 8px; }
    .btn { font-size: 13px; padding: 8px 14px; min-height: 36px; }
    .stat-card .number { font-size: 20px; }
    .stat-card { padding: 12px; }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .container { max-width: 960px; }
    .card { padding: 24px 28px; }
}

@media (min-width: 1400px) {
    .container { max-width: 1320px; }
    .card { padding: 36px 40px; }
}