/* 自动发卡平台 - 样式表 */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

/* 导航栏 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.navbar a { color: #fff; text-decoration: none; }
.navbar .logo { font-size: 20px; font-weight: bold; }
.navbar .nav-links { display: flex; gap: 20px; align-items: center; }
.navbar .nav-links a { padding: 6px 12px; border-radius: 4px; transition: background 0.2s; }
.navbar .nav-links a:hover { background: rgba(255,255,255,0.2); }
.navbar .user-info { font-size: 14px; opacity: 0.9; }

/* 容器 */
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }

/* 卡片 */
.card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    padding: 24px;
    margin-bottom: 20px;
}
.card-title { font-size: 18px; font-weight: 600; margin-bottom: 16px; color: #444; 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; font-size: 14px; }
.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    background: #fafafa;
}
.form-control:focus { outline: none; border-color: #667eea; background: #fff; box-shadow: 0 0 0 3px rgba(102,126,234,0.1); }
textarea.form-control { min-height: 100px; resize: vertical; }

/* 按钮 */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
    text-align: center;
}
.btn-primary { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(102,126,234,0.4); }
.btn-success { background: #28a745; color: #fff; }
.btn-success:hover { background: #218838; }
.btn-danger { background: #dc3545; color: #fff; }
.btn-danger:hover { background: #c82333; }
.btn-warning { background: #ffc107; color: #333; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-block { display: block; width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
table th, table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}
table th { background: #f8f9fa; font-weight: 600; color: #555; white-space: nowrap; }
table tr:hover { background: #f8f9ff; }

/* 提示信息 */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeaa7; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* 徽章 */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}
.badge-success { background: #d4edda; color: #155724; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-info { background: #d1ecf1; color: #0c5460; }

/* 状态网格 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.stat-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    text-align: center;
}
.stat-card .stat-value { font-size: 32px; font-weight: bold; color: #667eea; }
.stat-card .stat-label { font-size: 13px; color: #999; margin-top: 4px; }

/* 分类卡片 */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}
.category-item {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid transparent;
}
.category-item:hover { transform: translateY(-4px); box-shadow: 0 6px 20px rgba(0,0,0,0.1); border-color: #667eea; }
.category-item .cat-name { font-size: 20px; font-weight: bold; margin-bottom: 8px; }
.category-item .cat-price { font-size: 28px; color: #e74c3c; font-weight: bold; margin-bottom: 8px; }
.category-item .cat-stock { font-size: 13px; color: #999; margin-bottom: 12px; }
.category-item .cat-desc { font-size: 13px; color: #777; margin-bottom: 16px; }

/* 登录/注册页面 */
.auth-container {
    max-width: 420px;
    margin: 80px auto;
}
.auth-container .card { padding: 32px; }
.auth-container .site-title { text-align: center; font-size: 24px; font-weight: bold; color: #667eea; margin-bottom: 24px; }

/* 购买页面 */
.buy-form { max-width: 500px; }
.price-display {
    font-size: 36px;
    color: #e74c3c;
    font-weight: bold;
    text-align: center;
    margin: 16px 0;
}
.qrcode-container { text-align: center; margin: 20px 0; }
.qrcode-container img { border: 1px solid #eee; border-radius: 8px; max-width: 200px; }
.pay-hint { font-size: 13px; color: #999; text-align: center; margin-top: 8px; }

/* 页脚 */
.footer {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 13px;
    border-top: 1px solid #eee;
    margin-top: 40px;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}
.pagination a, .pagination span {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    text-decoration: none;
    color: #667eea;
}
.pagination a:hover { background: #667eea; color: #fff; border-color: #667eea; }
.pagination .current { background: #667eea; color: #fff; border-color: #667eea; }

/* 响应式 */
@media (max-width: 768px) {
    .navbar { flex-direction: column; height: auto; padding: 12px; }
    .navbar .nav-links { flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
    .container { padding: 12px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .category-grid { grid-template-columns: 1fr; }
    .auth-container { margin: 40px 16px; }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* 模态框 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

/* Tabs */
.tabs { display: flex; gap: 0; border-bottom: 2px solid #eee; margin-bottom: 20px; }
.tabs a {
    padding: 10px 20px;
    text-decoration: none;
    color: #666;
    font-size: 14px;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}
.tabs a:hover { color: #667eea; }
.tabs a.active { color: #667eea; border-bottom-color: #667eea; font-weight: 600; }

/* 复制提示 */
.copy-hint { cursor: pointer; color: #667eea; font-size: 12px; }
.copy-hint:hover { text-decoration: underline; }

/* 文本颜色 */
.text-success { color: #28a745; }
.text-danger { color: #dc3545; }
.text-warning { color: #ffc107; }
.text-muted { color: #999; }
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
