/* ==================== 陪玩报单系统 - 卡通极简风格 ==================== */

/* -- CSS变量 -- */
:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --accent: #f687b3;
    --bg: #f0f2f8;
    --card-bg: #ffffff;
    --text: #2d3748;
    --text-light: #718096;
    --text-muted: #a0aec0;
    --border: #e8ecf4;
    --shadow: 0 4px 20px rgba(102, 126, 234, 0.08);
    --shadow-hover: 0 8px 30px rgba(102, 126, 234, 0.15);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --font: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    --transition: all 0.2s ease;
    --nav-height: 64px;
}

/* -- Reset -- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; }
ul { list-style: none; }
input, select, textarea, button { font-family: inherit; }

/* ==================== 登录页 ==================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    padding: 20px;
}
.login-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    padding: 48px 40px 36px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}
.login-card .logo {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}
.login-card .subtitle {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 28px;
}
.role-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 24px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 4px;
}
.role-tab {
    flex: 1;
    padding: 10px 16px;
    border-radius: var(--radius-xs);
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.role-tab:hover { color: var(--text); }
.role-tab.active {
    background: var(--card-bg);
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(102,126,234,0.12);
}

/* -- 表单通用 -- */
.form-group {
    text-align: left;
    margin-bottom: 18px;
}
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}
.form-group .required::after {
    content: ' *';
    color: var(--accent);
}
.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text);
    background: var(--card-bg);
    transition: var(--transition);
    outline: none;
}
.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}
.form-input::placeholder { color: var(--text-muted); }
textarea.form-input { resize: vertical; min-height: 80px; }
select.form-input { cursor: pointer; }

/* -- 按钮 -- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
}
.btn-primary:hover {
    box-shadow: 0 4px 15px rgba(102,126,234,0.3);
    transform: translateY(-1px);
    color: #fff;
}
.btn-secondary {
    background: var(--bg);
    color: var(--text);
}
.btn-secondary:hover { background: var(--border); }
.btn-success {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: #fff;
}
.btn-success:hover { box-shadow: 0 4px 15px rgba(72,187,120,0.3); }
.btn-danger {
    background: linear-gradient(135deg, #fc5a5a, #e53e3e);
    color: #fff;
}
.btn-danger:hover { box-shadow: 0 4px 15px rgba(252,90,90,0.3); }
.btn-warning {
    background: linear-gradient(135deg, #f6ad55, #ed8936);
    color: #fff;
}
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-xs { padding: 4px 10px; font-size: 12px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

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

/* 侧栏 */
.sidebar {
    width: 240px;
    background: var(--card-bg);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}
.sidebar-header .logo {
    font-size: 20px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.sidebar-nav { flex: 1; padding: 12px; }
.nav-section { margin-bottom: 8px; }
.nav-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    padding: 8px 12px 4px;
    letter-spacing: 0.5px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-light);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
}
.nav-item:hover {
    background: var(--bg);
    color: var(--text);
}
.nav-item.active {
    background: linear-gradient(135deg, rgba(102,126,234,0.1), rgba(118,75,162,0.08));
    color: var(--primary);
    font-weight: 600;
}
.nav-item .badge {
    margin-left: auto;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 700;
}
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-light);
}

/* 主内容区 */
.main-content {
    flex: 1;
    margin-left: 240px;
    min-height: 100vh;
}
.topbar {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}
.topbar-title {
    font-size: 18px;
    font-weight: 700;
}
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.topbar-user {
    font-size: 14px;
    color: var(--text-light);
}
.content {
    padding: 28px 32px;
}

/* ==================== 卡片 ==================== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    transition: var(--transition);
}
.card:hover { box-shadow: var(--shadow-hover); }
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.card-title {
    font-size: 16px;
    font-weight: 700;
}

/* 统计卡片 */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.stat-card .icon {
    font-size: 28px;
    margin-bottom: 12px;
}
.stat-card .value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
}
.stat-card .label {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 4px;
}

/* ==================== 表格风格 ==================== */
.table-wrap {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
}
table th, table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
table th {
    font-weight: 600;
    color: var(--text-light);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: var(--bg);
}
table tr:hover td { background: rgba(102,126,234,0.02); }

/* ==================== 标签 ==================== */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.tag-pending { background: #fef3cd; color: #856404; }
.tag-active { background: #cce5ff; color: #004085; }
.tag-review { background: #d4edda; color: #155724; }
.tag-approved { background: #d4edda; color: #155724; }
.tag-rejected { background: #f8d7da; color: #721c24; }
.tag-cancelled { background: #e2e3e5; color: #383d41; }
.tag-success { background: #d4edda; color: #155724; }

/* ==================== 弹窗 ==================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 560px;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalIn 0.2s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}
.modal-header h3 { font-size: 18px; font-weight: 700; }
.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg);
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: var(--transition);
}
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-body { padding: 20px 24px; }
.modal-footer {
    padding: 16px 24px 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ==================== 过滤器 ==================== */
.filter-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    align-items: center;
}
.filter-bar .form-input { width: auto; min-width: 150px; }

/* ==================== 操作按钮组 ==================== */
.action-group {
    display: flex;
    gap: 6px;
}

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}
.empty-state .icon { font-size: 48px; margin-bottom: 16px; }
.empty-state p { font-size: 15px; }

/* ==================== 通知条 ==================== */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-info { background: #e8f4fd; color: #0652a5; }
.alert-success { background: #e8f8e8; color: #1a7d3a; }
.alert-danger { background: #fde8e8; color: #a51a1a; }
.alert-warning { background: #fef3cd; color: #856404; }

/* ==================== 报单卡片 ==================== */
.report-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 16px;
    border-left: 4px solid transparent;
    transition: var(--transition);
}
.report-card:hover { box-shadow: var(--shadow-hover); }
.report-card.pending { border-left-color: #f6ad55; }
.report-card.approved { border-left-color: #48bb78; }
.report-card.rejected { border-left-color: #fc5a5a; }
.report-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.report-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-light);
    flex-wrap: wrap;
}

/* ==================== 时间线 ==================== */
.timeline {
    position: relative;
    padding-left: 24px;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: var(--border);
}
.timeline-item {
    position: relative;
    padding-bottom: 20px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--card-bg);
}
.timeline-item .time {
    font-size: 12px;
    color: var(--text-muted);
}
.timeline-item .content {
    font-size: 14px;
    color: var(--text);
    padding: 0;
}

/* ==================== 浮窗通知 Toast ==================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 12px;
    max-width: 360px;
}
.toast {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    padding: 16px 20px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 4.7s forwards;
    cursor: pointer;
    border-left: 4px solid var(--primary);
}
.toast:hover { box-shadow: 0 8px 40px rgba(0,0,0,0.2); }
.toast-icon { font-size: 22px; line-height: 1.2; }
.toast-content { flex: 1; }
.toast-title { font-size: 14px; font-weight: 700; color: var(--text); }
.toast-message { font-size: 13px; color: var(--text-light); margin-top: 2px; }
.toast-close {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    line-height: 1;
}
.toast-close:hover { color: var(--text); }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100px); }
}
.toast-new-order { border-left-color: #667eea; }
.toast-new-report { border-left-color: #48bb78; }
.toast-withdrawal { border-left-color: #ed8936; }
.toast-review { border-left-color: #667eea; }
.toast-success { border-left-color: #48bb78; }
.toast-error { border-left-color: #fc5a5a; }

/* ==================== Dashboard ==================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; }
    .content { padding: 16px; }
    .topbar { padding: 0 16px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
    .login-card { padding: 32px 24px; }
}

/* ==================== 图片九宫格 ==================== */
.image-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 360px;
}
.image-grid .img-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
}
.image-grid .img-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.image-grid .img-item .img-del {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.image-grid .img-item .img-del:hover {
    background: rgba(229,62,62,0.8);
}
