/* 寿司郎取号小助手样式文件 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #BBDCE5 0%, #ECEEDF 100%);
    min-height: 100vh;
    padding: 10px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* 头部样式 */
.header {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-top: 10px;
    margin-bottom: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    text-align: center;
}

.header h1 {
    color: #333;
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.header p {
    color: #666;
    font-size: 1rem;
}

/* 反馈提示样式 */
.feedback-tip {
    color: #667eea !important;
    cursor: pointer;
    margin-top: 10px;
    transition: color 0.3s ease;
    font-size: 0.9rem;
}

.feedback-tip:hover {
    color: #4b68d1 !important;
}

.click-hint {
    color: #999;
    font-size: 0.8rem;
    font-style: italic;
}

/* 反馈悬浮层样式 */
.feedback-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.feedback-modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    position: relative;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.feedback-close {
    color: #999;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 15px;
    top: 10px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.feedback-close:hover {
    color: #333;
}

.feedback-modal-content h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.qr-image {
    max-width: 250px;
    width: 100%;
    height: auto;
    border-radius: 10px;
    border: 1px solid #e1e5e9;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.feedback-modal-content p {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

.wechat-contact {
    margin-top: 12px;
    color: #555;
    font-size: 0.9rem;
    line-height: 1.5;
}

.wechat-copy {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 4px;
    padding: 4px 10px;
    border: none;
    border-radius: 999px;
    background: #eef4ff;
    color: #3461ff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.wechat-copy:hover {
    background: #dbe7ff;
}

.wechat-copy:active {
    transform: translateY(1px);
}

.wechat-copy.copied {
    background: #d9f4e4;
    color: #1b7a3e;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translate(-50%, -60%) scale(0.9);
    }
    to { 
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.feedback-modal-content {
    transform: translate(-50%, -50%);
    position: absolute;
    left: 50%;
    top: 50%;
}

/* 控制面板样式 */
.controls {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* 表单网格 */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 6px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background-color: white;
    height: 36px;
}

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

.form-group select {
    cursor: pointer;
}

/* 日期范围标题样式 */
#dateRange {
    text-align: center;
    margin-bottom: 10px;
    color: #333;
}

/* 按钮样式 */
.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 10px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    margin: 5px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-width: 120px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.btn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

/* 统计卡片样式 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.stat-label {
    color: #666;
    font-size: 0.8rem;
}

/* 图表容器样式 */
.charts-container {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    overflow: hidden;
}

.chart {
    width: 100%;
    height: 350px;
    margin-bottom: 20px;
    min-width: 300px;
}

/* 加载和消息样式 */
.loading {
    text-align: center;
    padding: 50px;
    color: #666;
}

.error {
    background: linear-gradient(135deg, #ff4d4f 0%, #ff7875 100%);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
}

.warning {
    background: linear-gradient(135deg, #faad14 0%, #ffc53d 100%);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
}

.success {
    background: linear-gradient(135deg, #52c41a 0%, #73d13d 100%);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin: 15px 0;
}

/* 就餐分析结果样式 */
.dining-analysis-result {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
    border: 2px solid #e1e5e9;
}

.dining-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
    margin-top: 10px;
}

.dining-stat-card {
    background: linear-gradient(135deg, #52c41a 0%, #73d13d 100%);
    color: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.dining-stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 3px;
}

.dining-stat-label {
    font-size: 0.85rem;
    opacity: 0.9;
}

.dining-stat-title {
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 8px;
    opacity: 0.95;
}

.dining-stat-sub-info {
    font-size: 0.75rem;
    margin-top: 5px;
    opacity: 0.85;
    line-height: 1.2;
}

/* 移动端最早最晚时间换行显示 */
@media (max-width: 768px) {
    .dining-stat-sub-info {
        line-height: 1.4;
    }
    .dining-stat-sub-info .time-break {
        display: block;
        margin-top: 2px;
    }
    .dining-stat-sub-info .time-separator {
        display: none;
    }
}

.dining-history {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 5px 10px;
    margin-top: 10px;
}

.dining-history-item {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    gap: 15px;
}

.dining-history-item .history-date-weekday {
    justify-self: start;
    overflow: hidden;
}

.dining-history-item span:nth-child(2) {
    justify-self: center;
    white-space: nowrap;
}

.dining-history-item span:nth-child(3) {
    justify-self: end;
    white-space: nowrap;
}

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

.history-date-weekday {
    white-space: nowrap;
}

/* 置信度颜色 */
.confidence-high { color: #52c41a; }
.confidence-medium { color: #faad14; }
.confidence-low { color: #ff7875; }

/* 通用标签样式 */
.weekday, .weekend, .holiday {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
    font-size: inherit;
    line-height: 1;
    vertical-align: baseline;
    box-sizing: border-box;
    height: auto;
    min-height: auto;
}

.activity-tags {
    display: inline-flex;
    gap: 4px;
    margin-left: 6px;
    flex-wrap: wrap;
    vertical-align: baseline;
}

.activity-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: inherit;
    line-height: 1;
    background: linear-gradient(135deg, #fa8c16 0%, #fa541c 100%);
    color: #fff;
    white-space: nowrap;
}

.activity-tag-link {
    text-decoration: none;
}

.activity-tag-link:hover,
.activity-tag-link:focus {
    filter: brightness(0.95);
}

/* 工作日样式 */
.weekday {
    color: #1890ff;
    background-color: #f0f8ff;
}

/* 周末样式 */
.weekend {
    color: #ff4d4f;
    background-color: #fff5f5;
}

/* 节日样式 */
.holiday {
    color: white;
    background: linear-gradient(135deg, #ff6b9d 0%, #ff1744 100%);
    margin-left: 4px;
}



/* 桌面端隐藏移动端换行符 */
.mobile-br {
    display: none;
}

/* 就餐时间输入组合样式 */
.dining-time-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.dining-time-input-group input[type="time"] {
    flex: 1;
    height: 30px;
    box-sizing: border-box;
}

.dining-time-input-group .btn {
    height: 30px;
    padding: 0 16px;
    font-size: 0.95rem;
    white-space: nowrap;
    box-sizing: border-box;
    flex-shrink: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 1.4rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-grid .form-group {
        display: flex;
        align-items: center;  /* 垂直居中对齐 */
        gap: 10px;           /* label 和 select 之间的间距 */
        padding-left: 10px;
    }
    
    .form-grid .form-group label {
        margin-bottom: 0;    /* 移除下边距 */
        white-space: nowrap; /* 防止label换行 */
    }
    
    .form-grid .form-group select {
        flex: 1;             /* select占用剩余空间 */
    }
    
    .btn-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .stat-value {
        font-size: 1.3rem;
    }
    
    .chart {
        height: 280px;
    }
    
    .form-group input {
        font-size: 16px;
    }
    
    /* 移动端历史明细优化 */
    .dining-history-item {
        grid-template-columns: 1.2fr 1fr 0.9fr;
        gap: 8px;
    }
    
    .dining-history-item span:nth-child(2) {
        justify-self: center;
    }
    
    .dining-history-item span:nth-child(3) {
        justify-self: end;
    }
    
    .history-date-weekday {
        white-space: normal;
        line-height: 1.3;
        word-break: keep-all;
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        align-items: baseline;
    }
    
    .weekend, .weekday, .holiday {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    /* 周几和节日分组，确保在一行显示 */
    .weekday-holiday-group {
        display: inline-flex;
        align-items: baseline;
        gap: 4px;
        white-space: nowrap;
    }
    
    /* 移动端取号时间换行 */
    .mobile-br {
        display: block;
    }
    

    
    /* 移动端反馈弹窗优化 */
    .feedback-modal-content {
        width: 95%;
        max-width: 350px;
        padding: 20px;
        margin: 10% auto;
    }
    
    .qr-image {
        max-width: 200px;
    }
    
    .feedback-modal-content h3 {
        font-size: 1.1rem;
    }
}
