/* 单位订餐系统 - 全局样式 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #f5f6fa;
    color: #2c3e50;
    min-height: 100vh;
    padding-bottom: 80px;
}

/* 顶部导航 */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar h1 {
    font-size: 20px;
    font-weight: 600;
}

.navbar .user-info {
    font-size: 14px;
    opacity: 0.9;
    display: flex;
    gap: 12px;
    align-items: center;
}

.navbar a {
    color: white;
    text-decoration: none;
    font-size: 14px;
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.4);
}

/* 容器 */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
}

/* 卡片 */
.card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.card h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

/* 信息行 */
.info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 15px;
}

.info-row .label {
    color: #888;
}

.info-row .value {
    color: #333;
    font-weight: 500;
}

/* 餐桌选择区 */
.meal-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.meal-label {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.meal-deadline {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

.meal-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 开关样式 */
.toggle {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 28px;
}

.toggle .slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.toggle input:checked + .slider {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.toggle input:checked + .slider:before {
    transform: translateX(24px);
}

.toggle input:disabled + .slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.status-text {
    font-size: 14px;
    min-width: 40px;
    text-align: right;
}

.status-eating { color: #27ae60; font-weight: 600; }
.status-not-eating { color: #999; }

/* 按钮 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102,126,234,0.4);
}

.btn-wechat {
    display: block;
    background: #07c160;
    color: white;
    text-align: center;
    padding: 14px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: 0.2s;
}
.btn-wechat:hover {
    background: #06ad56;
    opacity: 0.9;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-block {
    display: block;
    width: 100%;
}

/* 消息提示 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 9999;
    animation: fadeIn 0.3s;
}

.toast.success { background: #27ae60; }
.toast.error { background: #e74c3c; }
.toast.warning { background: #f39c12; }

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

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

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

.login-card h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

/* 标签 */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.tag-blue { background: #e3f2fd; color: #1565c0; }
.tag-green { background: #e8f5e9; color: #2e7d32; }
.tag-orange { background: #fff3e0; color: #e65100; }
.tag-red { background: #ffebee; color: #c62828; }
.tag-gray { background: #f5f5f5; color: #757575; }

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

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.stat-card .number {
    font-size: 36px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card .label {
    font-size: 13px;
    color: #888;
    margin-top: 4px;
}

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

th, td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

th {
    color: #888;
    font-weight: 500;
    background: #fafafa;
}

/* 标签页 */
.tabs {
    display: flex;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.tab {
    flex: 1;
    padding: 14px;
    text-align: center;
    cursor: pointer;
    font-size: 15px;
    color: #888;
    border-bottom: 2px solid transparent;
    transition: 0.2s;
}

.tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* 响应式 */
@media (min-width: 768px) {
    .container {
        max-width: 800px;
    }
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* 底部工具栏 */
.bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    border-top: 1px solid #eee;
    z-index: 100;
}

.bottom-bar a {
    flex: 1;
    text-align: center;
    padding: 12px;
    color: #888;
    text-decoration: none;
    font-size: 13px;
    transition: 0.2s;
}

.bottom-bar a.active {
    color: #667eea;
    font-weight: 600;
}
