/* ===== 全局样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2d8cf0;
    --primary-dark: #1a6bc4;
    --primary-light: #e8f4ff;
    --success: #19be6b;
    --warning: #ff9900;
    --danger: #ed4014;
    --text: #333;
    --text-secondary: #666;
    --text-light: #999;
    --bg: #f5f7fa;
    --card-bg: #fff;
    --border: #e8eaec;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --radius: 8px;
    --radius-lg: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ===== 顶部导航 ===== */
.top-nav {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(45, 140, 240, 0.3);
}

.top-nav .back {
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

.top-nav .back:hover {
    background: rgba(255, 255, 255, 0.15);
}

.top-nav .title {
    font-size: 17px;
    font-weight: 600;
}

.top-nav .right {
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

.top-nav .right:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ===== 底部导航 ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    display: flex;
    border-top: 1px solid var(--border);
    z-index: 100;
    max-width: 480px;
    margin: 0 auto;
}

.bottom-nav a {
    flex: 1;
    text-align: center;
    padding: 6px 0 8px;
    font-size: 11px;
    color: var(--text-light);
    transition: color 0.2s;
}

.bottom-nav a .nav-icon {
    font-size: 22px;
    display: block;
    margin-bottom: 1px;
}

.bottom-nav a.active {
    color: var(--primary);
}

/* ===== 页面容器 ===== */
.page {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
    padding-bottom: 60px;
}

.page-full {
    max-width: 100%;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
}

/* ===== 卡片 ===== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    margin: 12px 16px;
    box-shadow: var(--shadow);
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ===== 按钮 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    gap: 6px;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 140, 240, 0.4);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: #17b15f;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background: #d3380f;
}

.btn-warning {
    background: var(--warning);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary-light);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
}

/* ===== 表单 ===== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
    background: var(--card-bg);
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45, 140, 240, 0.1);
}

.form-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45, 140, 240, 0.1);
}

/* ===== 状态标签 ===== */
.tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.tag-pending {
    background: #fff7e6;
    color: #e6a23c;
}

.tag-active {
    background: #e8f4ff;
    color: var(--primary);
}

.tag-completed {
    background: #e8f8e8;
    color: var(--success);
}

.tag-cancelled {
    background: #fce8e6;
    color: var(--danger);
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state .empty-icon {
    font-size: 60px;
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 15px;
}

/* ===== Toast 提示 ===== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    padding: 12px 28px;
    border-radius: var(--radius);
    font-size: 15px;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s;
    pointer-events: none;
    text-align: center;
    max-width: 80%;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* ===== 加载动画 ===== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.loading::after {
    content: '';
    width: 30px;
    height: 30px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== 徽章 ===== */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    border-radius: 9px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
}

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

/* ===== 弹窗/模态框 ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.show {
    display: flex;
}

.modal-box {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 100%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-box h3 {
    font-size: 18px;
    margin-bottom: 16px;
}
