/* ==================== 1. 基础重置与全局样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: url('./2.jpg') no-repeat center center fixed;
    background-size: cover;
    color: #333;
    min-height: 100vh;
    position: relative;
}

/*背景模糊遮罩*/
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: inherit;
    background-size: cover;
    filter: blur(3px);
    z-index: -1;
}

.content {
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.85);
    min-height: 100vh;
    border-radius: 10px;
    margin-bottom: 100px; /* 为底部导航留空 */
    backdrop-filter: blur(2px);
}

h2 {
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.8rem;
    color: #333;
}

/* ==================== 2. 首页与板块样式 ==================== */
.main-image {
    width: 100%;
    height: 200px;
    background-image: url('./2.jpg');
    background-size: cover;
    background-position: center;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.trending, .fun, .entertainment, .tech {
    margin-top: 20px;
}

.trending h3, .fun h3, .entertainment h3, .tech h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    text-align: center;
    color: #555;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 10px;
}

.image-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.thumbnail {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
    text-align: center;
    align-content: center;
    font-size: 20px;
}

.description {
    padding: 10px;
    font-size: 0.9rem;
    text-align: center;
    color: #666;
}

/* ==================== 3. 底部导航栏 ==================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.95);
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #666;
    font-size: 0.9rem;
    padding: 5px;
}

.nav-item.active {
    color: #007bff;
    font-weight: bold;
}

.nav-item .icon {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

/* ==================== 4. 大转盘样式 ==================== */
.wheel-entry {
    text-align: center;
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    font-size: 24px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.wheel-entry:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.wheel-section {
    width: 90%;
    max-width: 300px;
    margin: 20px auto;
    text-align: center;
}

.title {
    font-size: 16px;
    margin-bottom: 10px;
}

.wheel-container {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    position: relative;
    background-color: white;
    border: 2px solid #ccc;
    margin: 20px auto;
}

.wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(
        #ff6b6b 0deg 60deg,
        #4ecdc4 60deg 120deg,
        #ffe066 120deg 180deg,
        #9d65c9 180deg 240deg,
        #55acee 240deg 300deg,
        #ff9a8b 300deg 360deg
    );
    position: relative;
    transition: transform 5s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
    overflow: hidden;
}

.wheel span {
    position: absolute;
    top: 40%;
    left: 0%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 2px rgba(0,0,0,0.5);
    width: 100%;
    height: 100%;
    text-align: center;
    padding-top: 10px;
}

/* 转盘文字定位 */
.wheel span:nth-child(1) { transform: rotate(0deg) translate(0, -100px) rotate(30deg); }
.wheel span:nth-child(2) { transform: rotate(0deg) translate(0, -100px) rotate(90deg); }
.wheel span:nth-child(3) { transform: rotate(0deg) translate(0, -100px) rotate(150deg); }
.wheel span:nth-child(4) { transform: rotate(0deg) translate(0, -100px) rotate(-150deg); }
.wheel span:nth-child(5) { transform: rotate(0deg) translate(0, -100px) rotate(-90deg); }
.wheel span:nth-child(6) { transform: rotate(0deg) translate(0, -100px) rotate(-30deg); }

.pointer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-10px);
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 20px solid red;
    z-index: 10;
}

.result-area {
    margin-top: 20px;
    font-size: 16px;
    color: #333;
}

.rotate-btn {
    margin-top: 20px;
    padding: 10px 20px;
    font-size: 16px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

.rotate-btn:hover {
    background: #0056b3;
}

.code-input-area {
    width: 100%;
    margin: 20px auto;
    text-align: center;
}

#code-input {
    padding: 10px;
    font-size: 16px;
    width: 170px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#validate-btn {
    margin-left: 10px;
    padding: 10px 20px;
    font-size: 16px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#validate-btn:hover {
    background: #0056b3;
}

/* ==================== 5. 详情页样式 ==================== */
.detail-header {
    padding: 20px;
    border-bottom: 1px solid #ddd;
    text-align: center;
    height: 40vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.original-name {
    margin: 20px 0;
    font-size: 32px;
    color: #333;
    font-weight: bold;
    white-space: pre-wrap;
}

.original-price {
    margin: 20px 0;
    color: #e74c3c;
    line-height: 1.5;
}

.price-number {
    font-size: 32px;
    font-weight: bold;
}

.price-unit {
    font-size: 18px;
}

.detail-content {
    padding: 20px;
    border-bottom: 1px solid #ddd;
}

.detail-content h3 {
    color: #555;
    margin: 20px 0;
}

.playway {
    margin: 10px 0;
    color: #666;
    white-space: pre-wrap;
}

.board-notes {
    padding: 20px;
    border-bottom: 1px solid #ddd;
}

.back-btn button {
    background: rgba(0, 0, 0, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    padding: 10px 15px;
    border-radius: 50%;
    cursor: pointer;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-btn button:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* ==================== 6. 评论区样式 ==================== */
.comments-section {
    padding: 25px 20px;
    border-bottom: 1px solid #eee;
    background: linear-gradient(180deg, #fafafa 0%, #fff 100%);
}

.comments-section h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comments-section h3::before {
    content: '💬';
    font-size: 1.5rem;
}

.comment-list {
    margin-bottom: 20px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

/* 滚动条美化 */
.comment-list::-webkit-scrollbar { width: 6px; }
.comment-list::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 3px; }
.comment-list::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }
.comment-list::-webkit-scrollbar-thumb:hover { background: #a1a1a1; }

.comment-item {
    display: flex;
    gap: 12px;
    padding: 15px;
    margin-bottom: 15px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    animation: slideIn 0.3s ease;
}

.comment-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.comment-item::before {
    content: attr(data-user);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    flex-shrink: 0;
}

/* 不同评论头像颜色 */
.comment-item:nth-child(1)::before { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.comment-item:nth-child(2)::before { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.comment-item:nth-child(3)::before { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }

.comment-content { flex: 1; min-width: 0; }
.comment-user { font-weight: 600; color: #333; margin-bottom: 6px; font-size: 0.95rem; }
.comment-text { color: #555; line-height: 1.6; font-size: 0.9rem; word-break: break-word; }
.comment-time { font-size: 0.75rem; color: #999; margin-top: 8px; }

.comment-notice {
    padding: 15px 20px;
    background: linear-gradient(135deg, #fff5e6 0%, #ffe6f0 100%);
    border-radius: 10px;
    border-left: 4px solid #ff6b9d;
    color: #666;
    font-size: 0.85rem;
    line-height: 1.8;
    margin-top: 15px;
}

.comment-notice p { margin: 5px 0; }
.comment-notice .notice-icon { font-size: 1.2rem; margin-right: 5px; }

.comment-list:empty::after {
    content: '暂无评论，快来抢沙发吧~';
    display: block;
    text-align: center;
    padding: 30px;
    color: #999;
    font-size: 0.9rem;
    background: #f9f9f9;
    border-radius: 8px;
}

/* ==================== 7. 固定底部按钮 ==================== */
.go-order-btn {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 99;
}

.go-order-btn .btn-primary {
    width: 100%;
    background: #fff;
    color: #667eea;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.go-order-btn .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.go-order-btn .btn-primary:active {
    transform: translateY(0);
}

/* 详情页底部留白，防止被按钮遮挡 */
#detail .board-notes,
#detail .comments-section {
    padding-bottom: 80px;
}

/* ==================== 8. 模态框 (统一为粉色精致风格) ==================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #fff5f8 100%);
    padding: 30px 25px;
    border-radius: 16px;
    width: 85%;
    max-width: 420px;
    box-shadow: 0 10px 40px rgba(255, 107, 157, 0.3);
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #999;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close:hover {
    color: #ff6b9d;
    background: rgba(255, 107, 157, 0.1);
}

.modal-content h3 {
    text-align: center;
    color: #333;
    font-size: 1.4rem;
    margin: 0 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid #ffe6f0;
}

.form-group {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.form-group label {
    min-width: 50px;
    font-weight: 600;
    color: #555;
    font-size: 0.95rem;
    white-space: nowrap;
}

.btn-group {
    display: flex;
    gap: 8px;
    flex: 1;
    flex-wrap: wrap;
}

.btn-option {
    padding: 10px 15px;
    border: 2px solid #ffd6e7;
    background: white;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    flex: 1;
    font-size: 0.9rem;
    color: #555;
    min-width: 60px;
}

.btn-option:hover {
    border-color: #ff6b9d;
    background: rgba(255, 107, 157, 0.05);
    transform: translateY(-2px);
}

.btn-option.active {
    background: linear-gradient(135deg, #ff6b9d 0%, #ff85a2 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
}

.input-field {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ffd6e7;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: white;
}

.input-field:focus {
    outline: none;
    border-color: #ff6b9d;
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.1);
}

.input-field::placeholder {
    color: #aaa;
}

/* 统一的主按钮样式 (粉色) */
.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #ff6b9d 0%, #ff85a2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

/* ==================== 9. 派单大厅 (订单列表 - 主题美化版) ==================== */
.order-list {
    padding: 15px;
    max-width: 600px;
    margin: 0 auto;
}

.order-card {
    border-radius: 12px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    /* 默认边框，防止透明背景时轮廓不清 */
    border: 1px solid rgba(255, 255, 255, 0.2); 
}

.order-card:active {
    transform: scale(0.98);
}

/* --- ✅ 待接单：炫酷紫蓝渐变风格 --- */
.order-card:has(.status-pending) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff; /* 强制文字变白 */
    box-shadow: 0 8px 20px rgba(118, 75, 162, 0.25); /* 紫色光晕阴影 */
    border: none;
}

/* 待接单状态下的内部元素颜色适配 */
.order-card:has(.status-pending) .seq-badge {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

.order-card:has(.status-pending) .info-item .label {
    color: rgba(255, 255, 255, 0.8);
}

.order-card:has(.status-pending) .info-item .value {
    color: #fff;
    font-weight: 500;
}

.order-card:has(.status-pending) .card-footer {
    background: rgba(0, 0, 0, 0.1); /* 底部加深一点，突出状态标签 */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.order-card:has(.status-pending) .status-pending {
    background: #fff;
    color: #764ba2;
    border: none;
    font-weight: 700;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* --- ✅ 已派出：低调灰白风格 --- */
.order-card:has(.status-done) {
    background: #f9f9f9;
    color: #999;
    box-shadow: none;
    border: 1px solid #eee;
    opacity: 0.8; /* 稍微透明，表示非活跃 */
}

.order-card:has(.status-done) .seq-badge {
    background: #fff;
    color: #aaa;
    border-color: #ddd;
}

.order-card:has(.status-done) .info-item .value {
    color: #888;
}

.order-card:has(.status-done) .card-footer {
    background: #f0f0f0;
    border-top: 1px solid #e0e0e0;
}

.order-card:has(.status-done) .status-done {
    background: #e0e0e0;
    color: #757575;
    border: none;
}

/* --- 内部结构通用样式 --- */

.card-header {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    /* 渐变背景下不需要额外的header背景，保持通透 */
    background: transparent; 
}

.seq-badge {
    font-size: 14px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    transition: all 0.3s;
}

.card-body {
    padding: 10px 15px 15px 15px;
    flex: 1;
}

.info-item {
    display: flex;
    margin-bottom: 8px;
    align-items: baseline;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-item .label {
    width: 40px;
    font-size: 12px;
    flex-shrink: 0;
    transition: color 0.3s;
}

.info-item .value {
    flex: 1;
    font-size: 14px;
    word-break: break-word;
    transition: color 0.3s;
}

/* 名称稍微大一点 */
.info-item:nth-child(1) .value {
    font-size: 15px;
}

/* 时间胶囊样式 */
.info-item:nth-child(2) .value {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    /* 在紫色背景下，时间背景用半透明白；在灰色背景下，用浅灰 */
    background: rgba(255, 255, 255, 0.15); 
}

/* 针对灰色卡片的时间背景修正 */
.order-card:has(.status-done) .info-item:nth-child(2) .value {
    background: #eee;
    color: #777;
}

.card-footer {
    padding: 8px 15px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    transition: background 0.3s;
}
.status-tag {
    font-size: 12px;
    padding: 4px 10px 4px 6px; /* 左边距稍小，给圆点留空间 */
    border-radius: 20px;       /* 大圆角，形成胶囊形状 */
    font-weight: 600;
    display: inline-flex;      /* 使用 flex 以便对齐圆点和文字 */
    align-items: center;
    gap: 6px;                  /* 圆点和文字的间距 */
    letter-spacing: 0.5px;
    transition: all 0.3s;
    border: 1px solid transparent;
}

/* 利用 ::before 伪元素制作“绿点/灰点” */
.status-tag::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    box-shadow: 0 0 4px currentColor; /* 让圆点带一点同色光晕 */
}

/* --- ✅ 待接单：清新蓝白风格 + 绿色呼吸灯点 --- */
.order-card:has(.status-pending) .status-pending {
    background: #ffffff;
    color: #2d7be5;
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 待接单时的绿点 */
.order-card:has(.status-pending) .status-pending::before {
    background-color: #00e676; /* 鲜艳的绿色 */
    color: #00e676;            /* 用于 box-shadow 光晕 */
    animation: pulse-green 2s infinite; /* 可选：添加呼吸动画 */
}

/* 简单的呼吸动画 */
@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.7); }
    70% { box-shadow: 0 0 0 4px rgba(0, 230, 118, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 230, 118, 0); }
}

/* --- ✅ 已派出：低调灰白风格 + 灰色实心点 --- */
.order-card:has(.status-done) .status-done {
    background: #eeeeee;
    color: #757575;
    border-color: #e0e0e0;
}

/* 已完成时的灰点 */
.order-card:has(.status-done) .status-done::before {
    background-color: #9e9e9e;
    color: #9e9e9e;
    box-shadow: none; /* 灰色点不需要光晕 */
}

.empty-tip, .error-tip {
    text-align: center;
    padding: 40px 20px;
    color: #aaa;
    font-size: 14px;
    background: rgba(255,255,255,0.5);
    border-radius: 12px;
}
/* ==================== 10. 响应式调整 ==================== */
@media (max-width: 480px) {
    .content {
        padding: 15px;
    }

    h2 {
        font-size: 1.6rem;
    }

    .image-grid {
        gap: 10px;
    }

    /* 评论区移动端适配 */
    .comment-item {
        padding: 12px;
        gap: 10px;
    }
    
    .comment-item::before {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .comments-section {
        padding: 20px 15px;
    }

    /* 模态框移动端适配 */
    .modal-content {
        width: 90%;
        padding: 25px 20px;
    }
    
    .form-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .form-group label {
        min-width: auto;
    }
    
    .btn-group {
        width: 100%;
    }
    
    .btn-option {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}