/* ==========================================
   出行清单 - 样式（SKILL：清爽可靠、出行场景）
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700&family=DM+Sans:ital,wght@0,400;0,500;0,600;1,400&display=swap');

:root {
    --tc-bg: #f3f4f6; /* 干净的浅灰，无色彩倾向 */
    --tc-bg-card: #ffffff;
    --tc-text: #1f2937;
    --tc-text-muted: #6b7280;
    --tc-primary: #3b82f6; /* 清爽的经典蓝 */
    --tc-primary-hover: #2563eb;
    --tc-accent-done: #10b981;
    --tc-border: #e5e7eb;
    --tc-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    --tc-shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.06);
    --tc-radius: 16px;
    --tc-radius-sm: 8px;
    --tc-font-heading: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --tc-font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --tc-touch-min: 44px;
}

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

body {
    font-family: var(--tc-font-body);
    font-size: 16px;
    line-height: 1.5;
    background-color: var(--tc-bg);
    color: var(--tc-text);
    min-height: 100vh;
    padding: 16px;
}

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

/* ----- 标题区 ----- */
.header {
    margin-bottom: 24px;
}

.back-to-home {
    display: inline-block;
    font-size: 0.9rem;
    color: var(--tc-primary);
    text-decoration: none;
    margin-bottom: 12px;
    transition: color 0.2s;
}

.back-to-home:hover {
    color: var(--tc-primary-hover);
}

.header h1 {
    font-family: var(--tc-font-heading);
    font-weight: 700;
    font-size: 2.5rem;
    color: var(--tc-text);
    margin-bottom: 8px;
    text-align: center;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--tc-text-muted);
    text-align: center;
}

/* ----- 出行设定区 ----- */
.trip-setup-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius);
    box-shadow: var(--tc-shadow);
    padding: 18px;
    margin-bottom: 18px;
}

.setup-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.setup-head h2 {
    font-family: var(--tc-font-heading);
    font-size: 1.2rem;
    margin-bottom: 6px;
}

.setup-head p {
    color: var(--tc-text-muted);
    font-size: 0.9rem;
}

.setup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.setup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

.setup-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setup-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--tc-text);
}

.profile-toggle {
    display: flex;
    gap: 8px;
}

.profile-option {
    flex: 1;
    position: relative;
    cursor: pointer;
}

.profile-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.profile-option span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--tc-touch-min);
    border-radius: 999px;
    border: 1px solid var(--tc-border);
    background: var(--tc-bg-card);
    font-size: 0.95rem;
    font-weight: 600;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.profile-option input:checked + span {
    background: var(--tc-primary);
    color: #fff;
    border-color: var(--tc-primary);
}

#weather-select {
    width: 100%;
    min-height: var(--tc-touch-min);
    padding: 10px 12px;
    font-family: var(--tc-font-body);
    font-size: 0.95rem;
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius-sm);
    background: var(--tc-bg-card);
    color: var(--tc-text);
}

.setup-summary {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 0.9rem;
    line-height: 1.6;
}

.weather-advice-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.advice-panel {
    background: var(--tc-bg-card);
    border: 1px solid var(--tc-border);
    border-radius: 14px;
    overflow: hidden;
}

.advice-panel summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: var(--tc-touch-min);
    padding: 12px 14px;
    cursor: pointer;
    list-style: none;
}

.advice-panel summary::-webkit-details-marker {
    display: none;
}

.advice-panel summary::after {
    content: "展开";
    flex-shrink: 0;
    color: var(--tc-primary);
    font-size: 0.82rem;
    font-weight: 600;
}

.advice-panel[open] summary {
    border-bottom: 1px solid var(--tc-border);
}

.advice-panel[open] summary::after {
    content: "收起";
}

.advice-title {
    font-family: var(--tc-font-heading);
    font-size: 1rem;
    font-weight: 700;
}

.advice-count {
    margin-left: auto;
    color: var(--tc-text-muted);
    font-size: 0.82rem;
    white-space: nowrap;
}

.advice-list {
    margin: 0;
    padding: 12px 16px 14px 32px;
    color: var(--tc-text-muted);
    font-size: 0.9rem;
}

.advice-list li + li {
    margin-top: 8px;
}

/* ----- 清单选择区 ----- */
.list-toolbar {
    margin-bottom: 16px;
}

.list-switcher-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

#list-switcher {
    flex: 1;
    min-width: 120px;
    max-width: 220px;
    padding: 10px 12px;
    font-family: var(--tc-font-body);
    font-size: 0.95rem;
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius-sm);
    background: var(--tc-bg-card);
    color: var(--tc-text);
}

#list-switcher:focus {
    outline: 2px solid var(--tc-primary);
    outline-offset: 2px;
}

.management-wrap {
    display: flex;
    gap: 4px;
}

/* ----- 按钮通用 ----- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--tc-touch-min);
    padding: 0 24px;
    font-family: var(--tc-font-body);
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: 50px; /* 大圆角按钮 */
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s, transform 0.1s;
}

.btn:active {
    transform: scale(0.98);
}

.btn:focus-visible {
    outline: 2px solid var(--tc-primary);
    outline-offset: 2px;
}

.btn-primary {
    background-color: var(--tc-primary);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--tc-primary-hover);
}

.btn-secondary {
    background-color: var(--tc-bg-card);
    color: var(--tc-text);
    border: 1px solid var(--tc-border);
}

.btn-secondary:hover {
    border-color: var(--tc-primary);
    color: var(--tc-primary);
}

.btn-ghost {
    background: transparent;
    color: var(--tc-text-muted);
}

.btn-ghost:hover {
    color: var(--tc-primary);
}

.btn-danger-small {
    padding: 4px 10px;
    min-height: 32px;
    font-size: 0.8rem;
    background: transparent;
    color: var(--tc-text-muted);
    border: 1px solid var(--tc-border);
}

.btn-danger-small:hover {
    color: #b91c1c;
    border-color: #fca5a5;
}

.item-edit {
    padding: 4px 10px;
    min-height: 32px;
    font-size: 0.8rem;
}

/* 类型管理按钮：更醒目，便于发现可增删类型 */
.btn-types-manage {
    min-height: var(--tc-touch-min);
    padding: 0 14px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--tc-primary);
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid var(--tc-primary);
}

.btn-types-manage:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--tc-primary-hover);
    color: var(--tc-primary-hover);
}

/* ----- 进度区 ----- */
.progress-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 0.95rem;
    color: var(--tc-text-muted);
}

#progress-text {
    font-weight: 500;
    color: var(--tc-text);
}

.progress-all-done {
    font-weight: 600;
    color: var(--tc-accent-done);
}

.progress-all-done.hidden {
    display: none;
}

/* ----- 添加区 ----- */
.add-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

#new-item-input {
    flex: 1;
    min-width: 0;
    min-height: var(--tc-touch-min);
    padding: 10px 14px;
    font-family: var(--tc-font-body);
    font-size: 1rem;
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius-sm);
    background: var(--tc-bg-card);
}

#new-item-input:focus {
    outline: 2px solid var(--tc-primary);
    outline-offset: 0;
}

/* 类型：物品/事项 平铺可选，不收起 */
.type-options {
    display: flex;
    gap: 0;
    border-radius: var(--tc-radius-sm);
    border: 1px solid var(--tc-border);
    background: var(--tc-bg-card);
    overflow: hidden;
}

.type-option {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--tc-touch-min);
    min-width: 56px;
    padding: 0 14px;
    font-size: 0.9rem;
    cursor: pointer;
    border-right: 1px solid var(--tc-border);
    transition: background 0.2s, color 0.2s;
}

.type-option:last-child {
    border-right: none;
}

.type-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.type-option:has(input:checked) {
    background: var(--tc-primary);
    color: #fff;
}

.type-option:not(:has(input:checked)):hover {
    background: var(--tc-bg);
    color: var(--tc-text);
}

/* ----- 列表容器与分区 ----- */
.checklist-wrapper {
    margin-bottom: 24px;
}

.checklist-section {
    background: var(--tc-bg-card);
    border-radius: var(--tc-radius);
    box-shadow: var(--tc-shadow);
    padding: 16px;
    margin-bottom: 16px;
}

.section-title {
    font-family: var(--tc-font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--tc-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px dashed var(--tc-border);
}

.subsection {
    margin-bottom: 16px;
}

.subsection:last-child {
    margin-bottom: 0;
}

.subsection-title {
    font-family: var(--tc-font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--tc-text-muted);
    margin-bottom: 8px;
    padding-bottom: 4px;
}

.checklist-ul {
    list-style: none;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 8px;
    border-bottom: 1px solid #f3f4f6;
    animation: itemReveal 0.25s ease-out;
    transition: background 0.2s ease, border-radius 0.2s;
}

.checklist-item:hover {
    background: #f9fafb;
    border-radius: 8px;
    margin: 0 -8px;
    padding: 12px 16px;
}

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

.checklist-item.checked {
    opacity: 0.85;
}

.checklist-item.checked .item-text {
    text-decoration: line-through;
    color: var(--tc-text-muted);
}

@keyframes itemReveal {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.item-checkbox {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    accent-color: var(--tc-primary);
    cursor: pointer;
    border-radius: 6px;
    border: 2px solid var(--tc-border);
}

.item-type-tag {
    flex-shrink: 0;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--tc-bg);
    color: var(--tc-text-muted);
}

.item-type-tag.task {
    background: #e2e8f0;
    color: #475569;
}

.item-label-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.item-text {
    flex: 1;
    min-width: 0;
    font-size: 0.95rem;
    word-break: break-word;
    transition: color 0.2s, text-decoration 0.2s;
}

.item-text.inline-edit {
    display: none;
}

.item-edit-input {
    flex: 1;
    min-width: 0;
    padding: 6px 8px;
    font-family: var(--tc-font-body);
    font-size: 0.95rem;
    border: 1px solid var(--tc-primary);
    border-radius: var(--tc-radius-sm);
    display: none;
}

.item-edit-input.show {
    display: block;
}

.empty-hint {
    font-size: 0.9rem;
    color: var(--tc-text-muted);
    padding: 16px 0;
    text-align: center;
}

.empty-hint.hidden {
    display: none;
}

/* ----- 操作区 ----- */
.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* ----- 弹层 ----- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.4);
    animation: modalFade 0.2s ease-out;
}

.modal.hidden {
    display: none;
}

@keyframes modalFade {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--tc-bg-card);
    border-radius: var(--tc-radius);
    box-shadow: var(--tc-shadow-hover);
    padding: 24px;
    width: 100%;
    max-width: 360px;
}

.modal-title {
    font-family: var(--tc-font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.modal-content label {
    display: block;
    font-size: 0.9rem;
    color: var(--tc-text-muted);
    margin-bottom: 6px;
}

.modal-content input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    font-family: var(--tc-font-body);
    font-size: 1rem;
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius-sm);
    margin-bottom: 16px;
}

.modal-option {
    margin-bottom: 12px;
}

.modal-option label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 16px;
    margin-bottom: 0;
    cursor: pointer;
}

.modal-template-select {
    width: 100%;
    padding: 10px 12px;
    font-family: var(--tc-font-body);
    font-size: 0.95rem;
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius-sm);
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-content-wide {
    max-width: 420px;
}

.modal-hint {
    font-size: 0.85rem;
    color: var(--tc-text-muted);
    margin-bottom: 12px;
    line-height: 1.4;
}

.modal-type-add {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.modal-type-add input {
    flex: 1;
    padding: 8px 12px;
    font-family: var(--tc-font-body);
    font-size: 0.95rem;
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius-sm);
}

.modal-types-ul {
    list-style: none;
    margin-bottom: 16px;
}

.modal-type-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--tc-border);
}

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

.modal-type-name {
    flex: 1;
    font-weight: 500;
}

.content-section {
    margin-top: 24px;
    padding: 24px;
    border: 1px solid var(--tc-border);
    border-radius: 24px;
    background: rgba(255, 255, 252, 0.86);
    box-shadow: var(--tc-shadow);
}

.content-section h2,
.content-section h3 {
    color: var(--tc-primary-hover);
    letter-spacing: 0;
}

.content-section h3 {
    margin-top: 18px;
}

.content-section p {
    color: var(--tc-text-muted);
    line-height: 1.75;
    margin: 0 0 12px;
}

.content-section a {
    color: var(--tc-primary-hover);
    font-weight: 700;
}

/* ----- 无障碍 ----- */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ----- 响应式 ----- */
@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    .setup-head,
    .setup-grid,
    .weather-advice-grid {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .list-switcher-row {
        gap: 6px;
    }

    #list-switcher {
        max-width: none;
    }

    .add-row {
        flex-direction: column;
    }

    #new-item-input {
        width: 100%;
    }

    .action-row .btn {
        flex: 1;
        min-width: 0;
    }

    .section-title {
        font-size: 0.95rem;
    }

    .checklist-section {
        padding: 12px;
    }
}

/* 2026 visual refresh: travel companion surface */
:root {
    --tc-bg: #f4efe5;
    --tc-bg-card: rgba(255, 255, 252, 0.90);
    --tc-text: var(--gf-ink, #12201b);
    --tc-text-muted: var(--gf-ink-soft, #52635d);
    --tc-primary: var(--gf-green, #15735d);
    --tc-primary-hover: var(--gf-green-deep, #0d4f43);
    --tc-accent-done: #15735d;
    --tc-border: rgba(18, 32, 27, 0.13);
    --tc-shadow: 0 14px 34px rgba(18, 32, 27, 0.08);
    --tc-shadow-hover: 0 18px 45px rgba(18, 32, 27, 0.12);
    --tc-radius: 20px;
    --tc-radius-sm: 10px;
    --tc-font-heading: var(--gf-font-display, Georgia, "Times New Roman", serif);
    --tc-font-body: var(--gf-font, "Aptos", "Segoe UI", sans-serif);
}

body {
    background:
        radial-gradient(circle at 18% 0%, rgba(21, 115, 93, 0.12), transparent 24rem),
        radial-gradient(circle at 88% 8%, rgba(240, 164, 58, 0.16), transparent 22rem),
        linear-gradient(180deg, #fffdf7 0%, #f3eee4 100%);
    padding: 20px;
}

.container {
    max-width: 780px;
}

.header {
    position: relative;
    margin: 4px 0 22px;
    padding: 28px 28px 32px;
    border: 1px solid var(--tc-border);
    border-radius: 26px;
    background:
        linear-gradient(rgba(255, 255, 252, 0.86), rgba(255, 255, 252, 0.86)),
        url("../../static/goof.png") right 26px center / 104px auto no-repeat;
    box-shadow: var(--tc-shadow);
}

.back-to-home {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid var(--tc-border);
}

.header h1 {
    margin-top: 12px;
    text-align: left;
    font-size: clamp(2.4rem, 8vw, 4.2rem);
    letter-spacing: 0;
}

.subtitle {
    max-width: 440px;
    text-align: left;
}

.trip-setup-card,
.checklist-section,
.modal-content {
    backdrop-filter: blur(16px);
}

.trip-setup-card {
    padding: 22px;
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(223, 243, 233, 0.64), rgba(255, 255, 252, 0.90));
}

.setup-head h2,
.section-title,
.subsection-title,
.advice-title {
    letter-spacing: 0;
}

.setup-summary {
    background: rgba(21, 115, 93, 0.10);
    color: var(--tc-primary-hover);
    border: 1px solid rgba(21, 115, 93, 0.12);
}

.profile-option span,
#weather-select,
#list-switcher,
#new-item-input,
.type-options,
.advice-panel {
    background: rgba(255, 255, 255, 0.78);
}

.profile-option input:checked + span,
.type-option:has(input:checked) {
    background: linear-gradient(135deg, var(--tc-primary-hover), var(--tc-primary));
}

.advice-panel {
    border-radius: 16px;
}

.advice-panel summary {
    position: relative;
}

.advice-panel summary::after {
    color: var(--tc-primary-hover);
}

.list-switcher-row,
.add-row,
.action-row {
    padding: 10px;
    border: 1px solid var(--tc-border);
    border-radius: 18px;
    background: rgba(255, 255, 252, 0.62);
    box-shadow: 0 10px 28px rgba(18, 32, 27, 0.05);
}

.progress-row {
    justify-content: space-between;
    padding: 12px 16px;
    border: 1px solid var(--tc-border);
    border-radius: 999px;
    background: rgba(255, 255, 252, 0.70);
}

.checklist-section {
    border: 1px solid var(--tc-border);
    border-radius: 24px;
    background: rgba(255, 255, 252, 0.86);
}

.section-title {
    color: var(--tc-primary-hover);
    border-bottom: 1px solid rgba(21, 115, 93, 0.16);
}

.checklist-item {
    border-radius: 12px;
    border-bottom-color: rgba(18, 32, 27, 0.08);
}

.checklist-item:hover {
    background: rgba(223, 243, 233, 0.42);
    margin: 0;
    padding: 12px 8px;
}

.item-checkbox {
    accent-color: var(--tc-primary);
}

.item-type-tag {
    border-radius: 999px;
    background: rgba(21, 115, 93, 0.10);
    color: var(--tc-primary-hover);
}

.btn {
    border-radius: 999px;
}

@media (max-width: 768px) {
    body {
        padding: 12px;
    }

    .header {
        padding: 22px;
        background:
            linear-gradient(rgba(255, 255, 252, 0.88), rgba(255, 255, 252, 0.88)),
            url("../../static/goof.png") right 18px top 18px / 76px auto no-repeat;
    }
}
