/* 速记通管理面板 - iOS风格设计系统 */
:root {
    --bg-primary: #f2f2f7;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f9f9fb;
    --text-primary: #1c1c1e;
    --text-secondary: #3c3c43;
    --text-tertiary: #8e8e93;
    --text-quaternary: #c7c7cc;
    --accent: #007aff;
    --accent-light: rgba(0,122,255,0.1);
    --green: #34c759;
    --green-light: rgba(52,199,89,0.1);
    --orange: #ff9500;
    --orange-light: rgba(255,149,0,0.1);
    --red: #ff3b30;
    --red-light: rgba(255,59,48,0.1);
    --purple: #af52de;
    --purple-light: rgba(175,82,222,0.1);
    --separator: rgba(60,60,67,0.1);
    --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.08);
    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 7px;
    --transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ==================== 登录页 ==================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-card {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 48px 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.login-card h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.login-card .subtitle {
    font-size: 15px;
    color: var(--text-tertiary);
    margin-bottom: 32px;
}

.login-card .logo {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #007aff, #5856d6);
    border-radius: 18px;
    margin: 0 auto 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
    box-shadow: 0 4px 16px rgba(0,122,255,0.3);
}

/* ==================== 表单元素 ==================== */
.form-group {
    margin-bottom: 16px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--separator);
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-family: inherit;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transition: var(--transition);
    outline: none;
}

.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: white;
    width: 100%;
}

.btn-primary:hover { background: #0066d6; transform: translateY(-1px); }

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: var(--radius-xs);
}

.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { background: #e6352b; }

.btn-success { background: var(--green); color: white; }
.btn-success:hover { background: #2db84e; }

.btn-outline {
    background: transparent;
    border: 1px solid var(--separator);
    color: var(--text-secondary);
}
.btn-outline:hover { background: var(--bg-tertiary); }

/* ==================== 主布局 ==================== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--separator);
    padding: 20px 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 0 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand .logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #007aff, #5856d6);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    flex-shrink: 0;
}

.sidebar-brand h2 {
    font-size: 18px;
    font-weight: 700;
}

.sidebar-brand span {
    font-size: 12px;
    color: var(--text-tertiary);
    display: block;
}

.sidebar-nav {
    flex: 1;
    padding: 0 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 2px;
    cursor: pointer;
}

.nav-item:hover { background: var(--bg-tertiary); color: var(--text-primary); }

.nav-item.active {
    background: var(--accent-light);
    color: var(--accent);
}

.nav-item .icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.nav-item .badge {
    margin-left: auto;
    background: var(--red);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--separator);
}

.sidebar-footer .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-tertiary);
}

.sidebar-footer .avatar {
    width: 32px;
    height: 32px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--text-secondary);
}

/* 主内容区 */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 32px;
    min-height: 100vh;
}

.page-header {
    margin-bottom: 28px;
}

.page-header h1 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.page-header p {
    font-size: 15px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

/* ==================== 统计卡片 ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

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

.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 14px;
}

.stat-card .stat-icon.blue { background: var(--accent-light); color: var(--accent); }
.stat-card .stat-icon.green { background: var(--green-light); color: var(--green); }
.stat-card .stat-icon.orange { background: var(--orange-light); color: var(--orange); }
.stat-card .stat-icon.purple { background: var(--purple-light); color: var(--purple); }
.stat-card .stat-icon.red { background: var(--red-light); color: var(--red); }

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 2px;
    font-weight: 500;
}

/* ==================== 卡片容器 ==================== */
.card {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--separator);
}

.card-header h3 {
    font-size: 17px;
    font-weight: 600;
}

.card-body { padding: 0; }
.card-body.padded { padding: 20px; }

/* ==================== 表格 ==================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    padding: 12px 20px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--separator);
}

.data-table td {
    padding: 14px 20px;
    font-size: 14px;
    border-bottom: 1px solid var(--separator);
    vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }

.data-table tr:hover td { background: var(--bg-tertiary); }

/* ==================== 标签 ==================== */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.tag-blue { background: var(--accent-light); color: var(--accent); }
.tag-green { background: var(--green-light); color: var(--green); }
.tag-orange { background: var(--orange-light); color: var(--orange); }
.tag-red { background: var(--red-light); color: var(--red); }
.tag-purple { background: var(--purple-light); color: var(--purple); }
.tag-gray { background: var(--bg-tertiary); color: var(--text-tertiary); }

/* ==================== VIP徽章 ==================== */
.vip-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.vip-0 { background: var(--bg-tertiary); color: var(--text-tertiary); }
.vip-1 { background: var(--orange-light); color: var(--orange); }
.vip-2 { background: var(--purple-light); color: var(--purple); }
.vip-3 { background: linear-gradient(135deg, #ffd700, #ffaa00); color: #7c5800; }

/* ==================== 搜索栏 ==================== */
.search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    padding: 10px 16px 10px 40px;
    border: 1px solid var(--separator);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: inherit;
    background: var(--bg-secondary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='%238e8e93' viewBox='0 0 24 24'%3E%3Cpath d='M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E") 14px center no-repeat;
    color: var(--text-primary);
    transition: var(--transition);
    outline: none;
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-light);
}

/* ==================== 分页 ==================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-top: 1px solid var(--separator);
    font-size: 13px;
    color: var(--text-tertiary);
}

.pagination .page-btns {
    display: flex;
    gap: 4px;
}

.pagination .page-btn {
    padding: 6px 12px;
    border: 1px solid var(--separator);
    border-radius: var(--radius-xs);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.pagination .page-btn:hover { background: var(--bg-tertiary); }
.pagination .page-btn.active { background: var(--accent); color: white; border-color: var(--accent); }
.pagination .page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ==================== 模态框 ==================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--bg-secondary);
    border-radius: 20px;
    width: 100%;
    max-width: 520px;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--separator);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 { font-size: 18px; font-weight: 600; }

.modal-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover { background: var(--red-light); color: var(--red); }

.modal-body { padding: 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--separator);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
}

.empty-state .icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: 14px; }

/* ==================== Toast通知 ==================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    background: var(--bg-secondary);
    box-shadow: var(--shadow-lg);
    font-size: 14px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
}

.toast.success { border-left: 4px solid var(--green); }
.toast.error { border-left: 4px solid var(--red); }
.toast.info { border-left: 4px solid var(--accent); }

/* ==================== 动画 ==================== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes slideIn { from { transform: translateX(100px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; padding: 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .page-header h1 { font-size: 24px; }
}

/* ==================== 加载动画 ==================== */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--separator);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ==================== 趋势图占位 ==================== */
.trend-chart {
    height: 200px;
    display: flex;
    align-items: flex-end;
    gap: 6px;
    padding: 20px;
}

.trend-bar {
    flex: 1;
    border-radius: 4px 4px 0 0;
    transition: height 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    min-height: 4px;
}

.trend-bar .tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: white;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    margin-bottom: 4px;
}

.trend-bar:hover .tooltip { opacity: 1; }

/* ==================== 详情列表 ==================== */
.detail-list { list-style: none; }

.detail-list li {
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--separator);
    font-size: 14px;
}

.detail-list li:last-child { border-bottom: none; }

.detail-list .label { color: var(--text-tertiary); font-weight: 500; }
.detail-list .value { color: var(--text-primary); font-weight: 600; }