/* 餐饮多档口财务管理系统 - 样式 */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #0891b2;
    --light: #f8fafc;
    --dark: #1e293b;
    --gray: #64748b;
    --border: #e2e8f0;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f1f5f9;
    color: #1e293b;
    margin: 0;
    min-height: 100vh;
}

/* 水印 - 多层覆盖 */
.watermark-container {
    position: relative;
}

.watermark-container::before {
    content: attr(data-watermark);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 200px,
        rgba(0, 0, 0, 0.03) 200px,
        rgba(0, 0, 0, 0.03) 400px
    );
    pointer-events: none;
    z-index: 9999;
    color: transparent;
}

.watermark-text {
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    font-size: 11px;
    color: rgba(100, 116, 139, 0.15);
    white-space: nowrap;
}

.watermark-1 { top: 5%; left: 10%; transform: rotate(-15deg); }
.watermark-2 { top: 30%; right: 5%; transform: rotate(15deg); }
.watermark-3 { bottom: 15%; left: 20%; transform: rotate(-10deg); }
.watermark-4 { top: 60%; left: 50%; transform: rotate(10deg); }
.watermark-5 { bottom: 40%; right: 30%; transform: rotate(-20deg); }

/* 导航栏 */
.navbar-custom {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    padding: 0 16px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-custom .brand {
    font-size: 16px;
    font-weight: 700;
    color: white;
    text-decoration: none;
}

.navbar-custom .nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar-custom .user-info {
    font-size: 13px;
    color: #cbd5e1;
}

.navbar-custom .logout-btn {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 13px;
    padding: 4px 12px;
    border: 1px solid #475569;
    border-radius: 6px;
}

.navbar-custom .logout-btn:hover {
    background: #475569;
    color: white;
}

/* 底部标签栏（移动端） */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 1000;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
}

.bottom-nav a {
    text-decoration: none;
    color: var(--gray);
    font-size: 11px;
    text-align: center;
    flex: 1;
    padding: 4px;
}

.bottom-nav a.active {
    color: var(--primary);
}

.bottom-nav a .icon {
    font-size: 20px;
    display: block;
    margin-bottom: 2px;
}

/* 容器 */
.container-mobile {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
    padding-bottom: 70px;
}

/* 卡片 */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    margin-bottom: 16px;
    overflow: hidden;
}

.card-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 16px;
}

/* 统计卡片 */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: white;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.stat-card .stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    margin: 4px 0;
}

.stat-card .stat-label {
    font-size: 12px;
    color: var(--gray);
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    text-align: center;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-info { background: var(--info); color: white; }
.btn-secondary { background: #e2e8f0; color: var(--dark); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--gray); }
.btn-block { display: block; width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

/* 表格 */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th, .table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--gray);
    font-size: 12px;
    text-transform: uppercase;
}

/* 徽章 */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-secondary { background: #e2e8f0; color: #475569; }

/* 排名 */
.ranking-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.ranking-item:last-child {
    border-bottom: none;
}

.ranking-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-right: 12px;
    flex-shrink: 0;
}

.ranking-number.rank-1 { background: #fef3c7; color: #d97706; }
.ranking-number.rank-2 { background: #e2e8f0; color: #475569; }
.ranking-number.rank-3 { background: #fed7aa; color: #c2410c; }
.ranking-number.rank-other { background: #f1f5f9; color: var(--gray); }

.ranking-info {
    flex: 1;
}

.ranking-name {
    font-weight: 600;
    font-size: 14px;
}

.ranking-detail {
    font-size: 12px;
    color: var(--gray);
}

.ranking-profit {
    font-weight: 700;
    font-size: 14px;
    color: var(--success);
}

/* 确认标签 */
.confirm-tag {
    background: #fffbeb;
    border: 1px solid #fbbf24;
    border-radius: 8px;
    padding: 12px;
    margin: 12px 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.confirm-tag input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
}

.confirm-tag label {
    font-size: 13px;
    color: #92400e;
    font-weight: 600;
    margin: 0;
    cursor: pointer;
}

/* 提示消息 */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #fef3c7; color: #92400e; }
.alert-info { background: #dbeafe; color: #1e40af; }

/* 标签页 */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 16px;
    overflow-x: auto;
}

.tab {
    padding: 10px 16px;
    font-size: 14px;
    color: var(--gray);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

/* 警告标签 */
.warning-tag {
    background: #fee2e2;
    color: #991b1b;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
    margin: 2px;
}

.complaint-tag {
    background: #fef3c7;
    color: #92400e;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
    margin: 2px;
}

/* 文件上传 */
.file-upload {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
}

.file-upload:hover {
    border-color: var(--primary);
}

.file-upload input[type="file"] {
    display: none;
}

.file-upload .upload-icon {
    font-size: 24px;
    color: var(--gray);
}

.file-upload .upload-text {
    font-size: 13px;
    color: var(--gray);
    margin-top: 4px;
}

/* 响应式 */
@media (min-width: 768px) {
    .container-mobile {
        padding: 24px;
    }
    .stat-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    /* 桌面端底部导航改为横向滚动，保持可见 */
    .bottom-nav {
        max-width: 1200px;
        margin: 0 auto;
        border-radius: 12px 12px 0 0;
    }
}

/* 底部导航支持横向滚动 */
.bottom-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.bottom-nav::-webkit-scrollbar {
    display: none;
}

/* 快捷操作按钮网格 */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}
.quick-action {
    background: white;
    border-radius: 10px;
    padding: 14px 8px;
    text-align: center;
    text-decoration: none;
    color: var(--dark);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: transform 0.15s;
}
.quick-action:active {
    transform: scale(0.96);
}
.quick-action .qa-icon {
    font-size: 24px;
    display: block;
    margin-bottom: 4px;
}
.quick-action .qa-label {
    font-size: 11px;
    color: var(--gray);
    font-weight: 500;
}

/* 草稿保存提示 */
.draft-status {
    position: fixed;
    bottom: 80px;
    right: 16px;
    background: rgba(30, 41, 59, 0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    z-index: 1000;
    display: none;
}

.draft-status.show {
    display: block;
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 登录页 */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #475569 100%);
    padding: 16px;
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.login-title {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
}

.login-subtitle {
    text-align: center;
    font-size: 13px;
    color: var(--gray);
    margin-bottom: 24px;
}

/* 规则提示框 */
.rules-box {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

.rules-box h4 {
    font-size: 14px;
    color: #0369a1;
    margin: 0 0 8px 0;
}

.rules-box ul {
    margin: 0;
    padding-left: 20px;
    font-size: 13px;
    color: #0c4a6e;
}

.rules-box li {
    margin-bottom: 4px;
}

/* 成本项列表 */
.cost-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.cost-item-row:last-child {
    border-bottom: none;
}

.cost-item-name {
    font-size: 14px;
    font-weight: 500;
}

.cost-item-amount {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
}

.cost-item-auto {
    font-size: 11px;
    color: var(--gray);
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
}
