/* ========================================
   智游 Pro V8 - 终极修复版样式
   美化按钮 + 修复所有交互问题
   ======================================== */

* { margin: 0; padding: 0; box-sizing: border-box; }

.v8-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #f8fafc;
    min-height: 100vh;
}

/* 导航 */
.v8-nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 60px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    z-index: 1000;
}

.nav-inner {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 800;
    color: #111827;
    text-decoration: none;
}

.nav-user {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-login, .btn-register {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-login {
    background: transparent;
    color: #4f46e5;
    border: 1.5px solid #4f46e5;
}

.btn-login:hover {
    background: #eef2ff;
}

.btn-register {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
}

.btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f3f4f6;
    border-radius: 50px;
    text-decoration: none;
    color: #374151;
    font-weight: 500;
}

.avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
}

/* 布局 */
.v8-layout {
    display: flex;
    padding-top: 60px;
    min-height: 100vh;
}

/* 侧边栏 */
.v8-sidebar {
    width: 360px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #e5e7eb;
    height: calc(100vh - 60px);
    position: sticky;
    top: 60px;
    overflow-y: auto;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.sidebar-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
}

.sidebar-body {
    padding: 20px;
}

/* 智能推荐 */
.smart-box {
    padding: 14px;
    background: linear-gradient(135deg, #dbeafe, #eff6ff);
    border: 1px solid #93c5fd;
    border-radius: 10px;
    margin-bottom: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.smart-box strong {
    color: #1e40af;
}

.smart-box .use-btn {
    margin-left: auto;
    padding: 4px 12px;
    background: #3b82f6;
    color: #fff;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* 表单 */
.form-item {
    margin-bottom: 24px;
}

.form-item label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
}

.form-item input[type="text"],
.form-item textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-item input:focus,
.form-item textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-item textarea {
    min-height: 100px;
    resize: vertical;
}

/* ===== 美化热门城市按钮 ===== */
.hot-cities {
    margin-top: 12px;
}

.hot-label {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 10px;
}

.city-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.city-chips .chip {
    padding: 8px 16px;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    border: 1.5px solid #d1d5db;
    border-radius: 20px;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.city-chips .chip:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-color: #4f46e5;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* 天数选择 */
.day-btns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.day-btn {
    padding: 12px;
    background: #f3f4f6;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.day-btn:hover {
    border-color: #a5b4fc;
    background: #eef2ff;
}

.day-btn.active {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border-color: #4f46e5;
    color: #fff;
}

/* 偏好标签 */
.pref-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pref-tags .tag {
    padding: 8px 14px;
    background: #f3f4f6;
    border: 1.5px solid #e5e7eb;
    border-radius: 20px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.pref-tags .tag:hover {
    border-color: #a5b4fc;
}

.pref-tags .tag.active {
    background: linear-gradient(135deg, #dbeafe, #e0e7ff);
    border-color: #6366f1;
    color: #4338ca;
    font-weight: 500;
}

/* 快速标签 */
.quick-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.quick-tags button {
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 0.75rem;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.quick-tags button:hover {
    border-color: #4f46e5;
    color: #4f46e5;
    background: #eef2ff;
}

/* 开关 */
.switch-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.switch-label input {
    display: none;
}

.switch {
    width: 48px;
    height: 24px;
    background: #e5e7eb;
    border-radius: 12px;
    position: relative;
    transition: all 0.2s;
}

.switch::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.switch-label input:checked + .switch {
    background: #4f46e5;
}

.switch-label input:checked + .switch::after {
    left: 26px;
}

/* 生成按钮 */
.btn-generate {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
    transition: all 0.2s;
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

.btn-generate:active {
    transform: translateY(0);
}

.save-status {
    text-align: center;
    margin-top: 12px;
    font-size: 0.75rem;
    color: #10b981;
}

/* 主内容区 */
.v8-main {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

/* 空状态 */
.state-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 200px);
    text-align: center;
}

.empty-img {
    width: 140px;
    height: 140px;
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    border-radius: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    margin-bottom: 24px;
}

.state-empty h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.state-empty p {
    color: #6b7280;
}

/* 加载状态 */
.state-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 200px);
}

.spinner {
    width: 56px;
    height: 56px;
    border: 4px solid #e5e7eb;
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 24px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.progress {
    width: 200px;
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 16px;
}

.progress > div {
    height: 100%;
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
    border-radius: 2px;
    transition: width 0.3s;
    width: 0%;
}

/* 结果状态 */
.state-result {
    max-width: 900px;
    margin: 0 auto;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding: 16px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.toolbar-left, .toolbar-right {
    display: flex;
    gap: 10px;
}

.btn-tool {
    padding: 8px 16px;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-tool:hover {
    background: #e5e7eb;
}

.edit-tip {
    font-size: 0.875rem;
    color: #f59e0b;
}

.btn-export {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
}

.btn-export.word {
    background: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
}

/* 地图 */
.map-box {
    background: #fff;
    padding: 16px;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

#planMap {
    width: 100%;
    height: 400px;
    border-radius: 12px;
    background: #e5e7eb;
}

/* 概览 */
.overview {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 24px;
}

.overview h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.overview .stats {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
}

.overview .stats span {
    font-size: 0.875rem;
}

.overview .stats strong {
    font-size: 2rem;
    font-weight: 800;
    margin-right: 4px;
}

.overview .tips {
    background: rgba(255,255,255,0.15);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
}

/* 行程卡片 */
.itinerary {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.day-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.day-header {
    padding: 16px 20px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
}

.day-header .num {
    font-size: 1.25rem;
    font-weight: 800;
}

.day-header .title {
    font-size: 0.875rem;
    opacity: 0.9;
}

.spots-list {
    padding: 20px;
}

.spot-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    margin-bottom: 12px;
}

.spot-item .drag {
    padding: 4px;
    color: #94a3b8;
    cursor: grab;
    font-size: 1.25rem;
}

.spot-item .order {
    width: 28px;
    height: 28px;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
}

.spot-item .info {
    flex: 1;
}

.spot-item .info h4 {
    font-weight: 600;
    margin-bottom: 4px;
}

.spot-item .info p {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 8px;
}

.spot-item .reason {
    font-size: 0.875rem;
    color: #92400e;
    background: #fef3c7;
    padding: 6px 12px;
    border-radius: 6px;
}

/* 美食 */
.food-section {
    background: #fff;
    padding: 24px;
    border-radius: 16px;
    margin-top: 24px;
}

.food-section h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 20px;
}

/* 弹窗 */
.modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    background: rgba(0,0,0,0.5);
}

.modal.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    width: 90%;
    max-width: 400px;
    position: relative;
}

.btn-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
}

.modal-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.modal-content input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
}

.btn-submit {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
}

.switch {
    text-align: center;
    margin-top: 16px;
    font-size: 0.875rem;
    color: #6b7280;
}

.switch a {
    color: #4f46e5;
    font-weight: 600;
    cursor: pointer;
}

/* Toast */
#toastBox {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10001;
}

.toast {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    margin-top: 10px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

.toast.success { border-left: 4px solid #10b981; }
.toast.error { border-left: 4px solid #ef4444; }

/* 响应式 */
@media (max-width: 768px) {
    .v8-sidebar {
        position: fixed;
        left: 0;
        top: 60px;
        bottom: 0;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    .v8-sidebar.show {
        transform: translateX(0);
    }
}
