/* i茅台追踪系统 - 样式 */

:root {
    --primary: #c0392b;
    --primary-light: #e74c3c;
    --bg: #fafafa;
    --card-bg: #fff;
    --text: #333;
    --text-secondary: #666;
    --border: #e0e0e0;
    --success: #27ae60;
    --warning: #f39c12;
    --info: #2980b9;
    --danger: #e74c3c;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --radius: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Navigation */
nav {
    background: var(--primary);
    color: #fff;
    padding: 0 24px;
    display: flex;
    align-items: center;
    height: 54px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

nav .brand {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-right: 32px;
}

nav a {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    padding: 0 16px;
    height: 54px;
    display: flex;
    align-items: center;
    font-size: 14px;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

nav a:hover, nav a.active {
    color: #fff;
    background: rgba(255,255,255,0.1);
    border-bottom-color: #fff;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* Cards */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.card-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
}

.card-value.green { color: var(--success); }
.card-value.orange { color: var(--warning); }

/* Tables */
.table-wrap {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #f8f8f8;
    text-align: left;
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

tr:hover td { background: #fafafa; }

/* Status badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-pending { background: #fff3cd; color: #856404; }
.badge-shipped { background: #cce5ff; color: #004085; }
.badge-in_transit { background: #d4edda; color: #155724; }
.badge-delivered { background: #d1e7dd; color: #0f5132; }

.badge-sent { background: #d4edda; color: #155724; }
.badge-unsent { background: #f8d7da; color: #721c24; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    color: #fff;
}

.btn-primary { background: var(--primary); }
.btn-primary:hover { background: var(--primary-light); }
.btn-success { background: var(--success); }
.btn-success:hover { background: #219a52; }
.btn-outline {
    background: #fff;
    color: var(--primary);
    border: 1px solid var(--primary);
}
.btn-outline:hover { background: #fef2f2; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { opacity: 0.9; }
.btn-sm { padding: 4px 12px; font-size: 12px; }

/* Forms */
.form-group {
    margin-bottom: 16px;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

input, select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(192,57,43,0.1);
}

textarea { resize: vertical; min-height: 60px; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Page header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 22px;
    color: var(--text);
}

.page-header h1 small {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-left: 8px;
}

/* Section */
.section {
    margin-bottom: 24px;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
}

/* Alert */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success { background: #d4edda; color: #155724; }
.alert-error { background: #f8d7da; color: #721c24; }
.alert-info { background: #cce5ff; color: #004085; }

/* Modal */
.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.show { display: flex; }

.modal {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.modal h3 { margin-bottom: 16px; }

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 16px;
}

/* Empty state */
.empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
}

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

/* Filter bar */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    align-items: center;
}

.filter-bar select, .filter-bar input {
    width: auto;
    min-width: 140px;
}

/* Responsive */
@media (max-width: 768px) {
    .container { padding: 12px; }
    .cards { grid-template-columns: 1fr 1fr; }
    .form-row { grid-template-columns: 1fr; }
    nav { padding: 0 12px; }
    nav a { padding: 0 10px; font-size: 13px; }
}

/* Link display */
.link-display {
    background: #f8f8f8;
    padding: 8px 12px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
    word-break: break-all;
    color: var(--info);
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 16px;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.tab:hover { color: var(--text); }
.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Contact list card */
.list-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    margin-bottom: 16px;
}

.list-card h3 {
    font-size: 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.list-card h3 .count {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 400;
}

.member-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.member-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f0f0f0;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 13px;
}

.member-tag .remove-btn {
    cursor: pointer;
    color: var(--danger);
    font-weight: bold;
    font-size: 16px;
    line-height: 1;
}

.member-tag .remove-btn:hover { opacity: 0.7; }

/* v2 新增: 响应式 nav 支持更多链接 */
@media (max-width: 900px) {
    nav { flex-wrap: wrap; height: auto; padding: 8px 12px; }
    nav a { height: 36px; }
}

/* 发送管理面板统计卡片 */
.stat-mini {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    background: #f0f0f0;
}

/* 拖拽上传 */
.drop-zone.dragover {
    border-color: var(--primary) !important;
    background: #fef2f2 !important;
}

/* 二维码区域 */
.qr-box {
    display: inline-block;
    padding: 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
}

/* 通道标签 */
.ch-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    background: #f0f0f0;
}

/* 应急高亮 */
.emergency-highlight {
    animation: pulse 1s infinite;
}
@keyframes pulse {
    0%, 100% { background: #fff; }
    50% { background: #f8d7da; }
}
