* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    min-height: 100dvh;
    padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

body.guidance-sheet-open {
    overflow: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    padding: 20px;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

main {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

/* 当前日期显示 */
.current-date-display {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px;
    color: white;
    text-align: center;
    border-bottom: 3px solid rgba(255, 255, 255, 0.2);
}

.current-date-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

.current-date-info {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.current-date-label {
    font-size: 1.2em;
    margin: 0;
    opacity: 0.9;
    font-weight: 600;
}

.current-date-text {
    font-size: 2em;
    margin: 8px 0;
    font-weight: 700;
    letter-spacing: 1px;
}

.current-date-weekday {
    font-size: 1.1em;
    margin: 0;
    opacity: 0.85;
    font-weight: 500;
}

.current-date-lunar {
    font-size: 0.9em;
    margin: 5px 0 0 0;
    opacity: 0.8;
    color: #b0e0e6;
}

/* 导航标签 */
.nav-tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
    background: #f9f9f9;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    color: #666;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: #667eea;
    background: #f0f0f0;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
    padding: 30px;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 日历样式 */
.calendar-section {
    background: white;
}

.year-selector, .month-selector {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.year-select {
    padding: 10px 15px;
    border: 2px solid #667eea;
    border-radius: 5px;
    font-size: 1.1em;
    font-weight: 600;
    color: #667eea;
    cursor: pointer;
}

.year-select:focus {
    outline: none;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.month-selector h2 {
    min-width: 150px;
    text-align: center;
    color: #333;
    font-size: 1.5em;
}

.btn-nav {
    width: 40px;
    height: 40px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.2em;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-nav:hover {
    background: #667eea;
    color: white;
    transform: scale(1.05);
}

.calendar-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: visible;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.day-name {
    text-align: center;
    font-weight: 600;
    color: #667eea;
    padding: 10px;
    font-size: 0.95em;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    overflow: visible;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    position: relative;
    background: white;
    min-height: 75px;
    flex-direction: column;
    padding: 5px;
    overflow: visible;
    isolation: isolate;
    gap: 4px;
}

.calendar-day-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
    gap: 4px;
    min-width: 0;
}

.calendar-day-main {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.calendar-day-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 2px;
    width: 100%;
    min-width: 0;
}

.main-date {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    line-height: 1;
    flex-shrink: 0;
}

.today-label {
    font-size: 0.65em;
    color: white;
    background: #667eea;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
    flex-shrink: 0;
}

.lunar-date {
    font-size: 0.75em;
    color: #999;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
}

.reminder-indicator {
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    position: absolute;
    bottom: 4px;
    right: 4px;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
}

.calendar-day:hover {
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
    z-index: 30;
}

.calendar-day.has-guidance {
    border-color: #bfd2ff;
}

.guidance-mark {
    position: static;
    padding: 1px 6px;
    border-radius: 999px;
    background: #eef4ff;
    color: #4a67cc;
    font-size: 0.62em;
    font-weight: 700;
    line-height: 1.6;
    border: none;
    cursor: pointer;
    z-index: 3;
    flex-shrink: 0;
}

.guidance-mark:hover {
    background: #dfe9ff;
}

.guidance-mark:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.calendar-guidance-tooltip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 12px);
    transform: translateX(-50%) translateY(6px);
    width: 280px;
    max-width: min(280px, 80vw);
    padding: 14px 14px 12px;
    border-radius: 14px;
    background: rgba(22, 27, 43, 0.97);
    color: #fff;
    text-align: left;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 40;
}

.calendar-day.tooltip-left .calendar-guidance-tooltip {
    left: 0;
    transform: translateY(6px);
}

.calendar-day.tooltip-left .calendar-guidance-tooltip::after {
    left: 28px;
    transform: none;
}

.calendar-day.tooltip-right .calendar-guidance-tooltip {
    left: auto;
    right: 0;
    transform: translateY(6px);
}

.calendar-day.tooltip-right .calendar-guidance-tooltip::after {
    left: auto;
    right: 28px;
    transform: none;
}

.calendar-day.tooltip-below .calendar-guidance-tooltip {
    bottom: auto;
    top: calc(100% + 12px);
}

.calendar-day.tooltip-below .calendar-guidance-tooltip::after {
    top: auto;
    bottom: 100%;
    border-width: 0 7px 8px 7px;
    border-color: transparent transparent rgba(22, 27, 43, 0.97) transparent;
}

.calendar-guidance-tooltip::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%);
    border-width: 8px 7px 0 7px;
    border-style: solid;
    border-color: rgba(22, 27, 43, 0.97) transparent transparent transparent;
}

.calendar-day:hover .calendar-guidance-tooltip,
.calendar-day:focus-within .calendar-guidance-tooltip,
.calendar-day.guidance-open .calendar-guidance-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
    z-index: 120;
}

.calendar-day.tooltip-left:hover .calendar-guidance-tooltip,
.calendar-day.tooltip-left:focus-within .calendar-guidance-tooltip,
.calendar-day.tooltip-left.guidance-open .calendar-guidance-tooltip,
.calendar-day.tooltip-right:hover .calendar-guidance-tooltip,
.calendar-day.tooltip-right:focus-within .calendar-guidance-tooltip,
.calendar-day.tooltip-right.guidance-open .calendar-guidance-tooltip {
    transform: translateY(0);
}

.guidance-tooltip-title {
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #b9cbff;
}

.guidance-tooltip-item {
    margin-bottom: 8px;
    font-size: 12px;
    line-height: 1.7;
}

.guidance-tooltip-item strong {
    display: inline-block;
    min-width: 24px;
    color: #ffd777;
}

.guidance-tooltip-item span {
    color: #f6f7fb;
}

.guidance-tooltip-note {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    font-size: 12px;
    line-height: 1.7;
    color: #dbe5ff;
}

.calendar-brief {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    margin: 0 auto;
    text-align: center;
    line-height: 1.45;
}

.reminder-brief {
    color: #1e7a42;
    font-weight: 700;
}

.guidance-sheet {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(9, 15, 28, 0.42);
    align-items: flex-end;
    justify-content: center;
}

.guidance-sheet.show {
    display: flex;
}

.guidance-sheet-panel {
    width: min(720px, 100%);
    max-height: min(78vh, 760px);
    background: #fff;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -18px 40px rgba(17, 24, 39, 0.25);
    overflow: hidden;
    animation: guidanceSheetUp 0.24s ease;
}

@keyframes guidanceSheetUp {
    from {
        transform: translateY(24px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.guidance-sheet-handle {
    width: 48px;
    height: 5px;
    border-radius: 999px;
    background: #d7deef;
    margin: 10px auto 2px;
}

.guidance-sheet-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px 12px;
    border-bottom: 1px solid #ebf0fb;
}

.guidance-sheet-header h2 {
    margin: 0;
    color: #26304d;
    font-size: 1.15rem;
}

.guidance-sheet-meta {
    margin-top: 6px;
    color: #6a7493;
    font-size: 0.9rem;
    line-height: 1.6;
}

.guidance-sheet-close {
    width: 38px;
    height: 38px;
    background: #eef3ff;
    color: #566dcf;
    flex-shrink: 0;
}

.guidance-sheet-close:hover {
    background: #e0e8ff;
    transform: none;
}

.guidance-sheet-body {
    padding: 16px;
    overflow-y: auto;
}

.guidance-sheet-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.guidance-sheet-actions .btn {
    flex: 1 1 160px;
    min-height: 46px;
    border-radius: 12px;
    font-weight: 700;
}

.guidance-sheet-hint {
    margin-bottom: 14px;
    color: #66708c;
    font-size: 0.9rem;
    line-height: 1.7;
}

.guidance-sheet-body .date-guidance-panel {
    margin-bottom: 0;
    background: linear-gradient(180deg, #f8faff 0%, #eef3ff 100%);
}

@media (min-width: 769px) and (hover: hover) and (pointer: fine) {
    .calendar-day {
        align-items: center;
        justify-content: center;
        padding: 12px 8px 10px;
        min-height: 86px;
        gap: 6px;
        border-radius: 16px;
        border-color: #e3e8f6;
        background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
        box-shadow: 0 8px 18px rgba(31, 45, 84, 0.06);
    }

    .calendar-day-head {
        justify-content: center;
        align-items: center;
    }

    .calendar-day-main {
        justify-content: center;
    }

    .calendar-day-meta {
        align-items: center;
        justify-content: center;
        gap: 4px;
    }

    .main-date {
        font-size: 1.48em;
    }

    .today-label {
        font-size: 0.66em;
        padding: 3px 8px;
        letter-spacing: 0.4px;
    }

    .lunar-date {
        width: auto;
        max-width: 100%;
        font-size: 0.78em;
        text-align: center;
    }

    .holiday-name {
        font-size: 0.8em;
        text-align: center;
        white-space: normal;
        line-height: 1.45;
        padding: 0;
        border: none;
    }

    .guidance-mark {
        position: absolute;
        top: 8px;
        right: 8px;
    }

    .calendar-day:not(.today):not(.has-holiday) .main-date {
        color: #24304f;
    }

    .calendar-day:not(.today):not(.has-holiday) .lunar-date {
        color: #647089;
    }

    .calendar-day:not(.today):not(.has-holiday) .reminder-brief {
        color: #1d7a45;
    }

    .calendar-day:not(.today):not(.has-holiday):hover {
        border-color: #cbd7fb;
        background: linear-gradient(180deg, #ffffff 0%, #f2f6ff 100%);
        box-shadow: 0 14px 28px rgba(68, 90, 160, 0.14);
    }

    .calendar-day.today {
        background: radial-gradient(circle at top, rgba(190, 208, 255, 0.34), transparent 56%), linear-gradient(145deg, #456ff7 0%, #5e63df 100%);
        border-color: #5373f6;
        box-shadow: 0 18px 38px rgba(73, 100, 211, 0.34), 0 0 0 4px rgba(95, 128, 255, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.24);
        transform: translateY(-3px) scale(1.07);
    }

    .calendar-day.today .main-date {
        color: #fff;
        font-size: 1.82em;
        text-shadow: 0 2px 8px rgba(14, 22, 50, 0.28);
    }

    .calendar-day.today .today-label {
        background: rgba(255, 255, 255, 0.94);
        color: #3557db;
        border: 1px solid rgba(255, 255, 255, 0.54);
        box-shadow: 0 8px 14px rgba(24, 36, 92, 0.16);
    }

    .calendar-day.today .lunar-date {
        color: rgba(243, 246, 255, 0.92);
    }

    .calendar-day.today .holiday-name {
        color: #ffefbd;
    }

    .calendar-day.has-holiday {
        background: radial-gradient(circle at top, rgba(255, 255, 255, 0.62), transparent 48%), linear-gradient(145deg, #fff6e7 0%, #ffe8be 100%);
        border-color: #e3e8f6;
        box-shadow: 0 12px 24px rgba(213, 168, 84, 0.16);
        padding-top: 12px;
    }

    .calendar-day.has-holiday .main-date {
        color: #b65508;
    }

    .calendar-day.has-holiday .lunar-date {
        color: #9f6a32;
    }

    .calendar-day.has-holiday .holiday-name {
        color: #9c4508;
        font-weight: 800;
    }

    .calendar-day.has-holiday:hover {
        background: radial-gradient(circle at top, rgba(255, 255, 255, 0.72), transparent 48%), linear-gradient(145deg, #fff3d2 0%, #ffdca0 100%);
        border-color: #e3e8f6;
        box-shadow: 0 16px 28px rgba(216, 159, 58, 0.18);
    }

    .calendar-day.today.has-holiday {
        background: radial-gradient(circle at top, rgba(190, 208, 255, 0.34), transparent 56%), linear-gradient(145deg, #456ff7 0%, #5e63df 100%);
        border-color: #5373f6;
        box-shadow: 0 18px 38px rgba(73, 100, 211, 0.34), 0 0 0 4px rgba(95, 128, 255, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.24);
    }

    .calendar-day.today.has-holiday .holiday-name {
        color: #ffe9a1;
    }

    .calendar-day.today::after {
        content: none;
    }
}

@media (hover: none), (pointer: coarse) {
    .calendar-day:hover {
        transform: none;
    }

    .calendar-guidance-tooltip {
        display: none;
    }

    .guidance-mark {
        display: none;
    }
}

.calendar-day.other-month {
    color: #ccc;
    background: #f9f9f9;
    cursor: not-allowed;
    opacity: 0.5;
}

.calendar-day.other-month:hover {
    border-color: #e0e0e0;
    box-shadow: none;
    transform: none;
}

.calendar-day.today {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: bold;
    border-color: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.6), inset 0 0 15px rgba(255, 255, 255, 0.2);
    position: relative;
    transform: scale(1.12);
    z-index: 10;
}

.calendar-day.today .main-date {
    color: white;
}

.calendar-day.today .lunar-date {
    color: rgba(255, 255, 255, 0.9);
}

.calendar-day.has-reminder {
    border-color: #4CAF50;
    background: #f0f9f0;
}

.calendar-day.has-reminder:hover {
    background: #e8f5e8;
    border-color: #2e7d32;
}

/* 有节日的日期样式 */
.calendar-day.has-holiday {
    background: linear-gradient(135deg, #fff5e1 0%, #ffe0b2 100%);
    border-color: #ff9800;
}

.calendar-day.has-holiday .main-date {
    color: #ff6f00;
    font-weight: 700;
}

.calendar-day.has-holiday:hover {
    background: linear-gradient(135deg, #ffeb99 0%, #ffd54f 100%);
    border-color: #f57c00;
    box-shadow: 0 5px 15px rgba(255, 152, 0, 0.3);
}

.holiday-name {
    font-size: 0.75em;
    color: #d84315;
    font-weight: 700;
    background: rgba(255, 152, 0, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    width: 100%;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
    line-height: 1.3;
    overflow-wrap: anywhere;
    text-align: left;
}

/* 悬浮提示窗口 */
.day-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #333 0%, #1a1a1a 100%);
    color: white;
    border-radius: 10px;
    padding: 12px 16px;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    min-width: 170px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: tooltipShow 0.2s ease;
}

@keyframes tooltipShow {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.day-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
}

.tooltip-title {
    font-weight: 700;
    font-size: 0.95em;
    margin-bottom: 6px;
    color: #ffd700;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 4px;
}

.tooltip-date {
    font-weight: 600;
    font-size: 0.9em;
    margin-bottom: 4px;
    color: #ffffff;
}

.tooltip-lunar {
    font-size: 0.85em;
    color: #b0e0e6;
    margin-bottom: 4px;
}

.tooltip-holiday {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    margin: 6px 0;
    font-weight: 600;
    font-size: 0.9em;
    text-align: center;
}

.tooltip-text {
    font-size: 0.85em;
    color: #e8e8e8;
    margin: 4px 0;
    line-height: 1.5;
}

.tooltip-text strong {
    color: #ffd700;
}

/* 表单样式 */
.form-section {
    background: white;
}

.form-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

.weekday-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fafaff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.weekday-option:hover {
    border-color: #667eea;
    background: #f3f5ff;
}

.weekday-option input {
    width: auto;
    margin: 0;
}

.privacy-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.privacy-toggle input {
    width: auto;
    margin: 0;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="time"],
input[type="number"],
input[type="date"],
input[type="file"],
textarea,
select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="time"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="file"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.2);
}

textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.5;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-edit {
    background: #4CAF50;
    color: white;
    padding: 8px 15px;
    font-size: 0.9em;
}

.btn-edit:hover {
    background: #45a049;
}

.btn-delete {
    background: #f44336;
    color: white;
    padding: 8px 15px;
    font-size: 0.9em;
}

.btn-delete:hover {
    background: #da190b;
}

.btn-toggle {
    background: #2196F3;
    color: white;
    padding: 8px 15px;
    font-size: 0.9em;
}

.btn-toggle:hover {
    background: #0b7dda;
}

.btn-toggle.inactive {
    background: #999;
}

/* 列表样式 */
.list-section {
    background: white;
}

.list-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.reminders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.reminder-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 20px;
    border-radius: 8px;
    border-left: 5px solid #667eea;
    position: relative;
    transition: transform 0.3s, box-shadow 0.3s;
}

.reminder-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.reminder-card.inactive {
    opacity: 0.6;
    background: linear-gradient(135deg, #e8e8e8 0%, #d0d0d0 100%);
}

.reminder-card h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.reminder-info {
    margin-bottom: 15px;
    font-size: 0.95em;
}

.reminder-info p {
    color: #666;
    margin-bottom: 8px;
}

.reminder-info strong {
    color: #333;
}

.reminder-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #999;
}

.empty-state p {
    font-size: 1.1em;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid #e0e0e0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.3em;
}

.modal-close {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 20px;
}

.date-reminders {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.date-reminder-item {
    padding: 15px;
    background: #f9f9f9;
    border-left: 4px solid #667eea;
    border-radius: 5px;
}

.date-reminder-item h3 {
    color: #333;
    margin-bottom: 8px;
}

.date-reminder-item p {
    color: #666;
    font-size: 0.9em;
}

.date-guidance-panel {
    margin-bottom: 16px;
    padding: 16px 18px;
    border-radius: 12px;
    background: linear-gradient(180deg, #f7f9ff 0%, #eef3ff 100%);
    border: 1px solid #d8e3ff;
}

.date-guidance-panel h3 {
    margin-bottom: 10px;
    color: #34458f;
    font-size: 1rem;
}

.date-guidance-panel p {
    margin-bottom: 8px;
    color: #46506b;
    line-height: 1.75;
}

.date-guidance-panel p:last-child {
    margin-bottom: 0;
}

.no-reminders {
    text-align: center;
    padding: 30px;
    color: #999;
}

footer {
    text-align: center;
    color: white;
    margin-top: 30px;
    padding: 20px;
    opacity: 0.9;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 12px;
        padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    }

    header h1 {
        font-size: 1.8em;
    }

    main {
        border-radius: 8px;
    }

    .tab-content {
        padding: 18px 14px;
    }

    .year-selector, .month-selector {
        gap: 10px;
        margin-bottom: 18px;
    }

    .month-selector h2 {
        min-width: 0;
        font-size: 1.15em;
    }

    .calendar-container {
        padding: 10px;
    }

    .calendar-header,
    .calendar-grid {
        gap: 4px;
    }

    .day-name {
        padding: 6px 0;
        font-size: 0.8em;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .reminders-grid {
        grid-template-columns: 1fr;
    }

    .calendar-day {
        aspect-ratio: auto;
        min-height: 68px;
        font-size: 0.9em;
        padding: 6px 5px;
    }

    .main-date {
        font-size: 1em;
    }

    .today-label {
        font-size: 0.56em;
        padding: 1px 5px;
    }

    .guidance-mark {
        padding: 1px 5px;
        font-size: 0.56em;
    }

    .lunar-date,
    .holiday-name {
        font-size: 0.64em;
    }

    .calendar-day.today {
        transform: scale(1);
    }

    .nav-tabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0;
    }

    .tab-btn {
        min-width: 0;
        padding: 12px 8px;
        font-size: 0.92em;
    }

    .modal-content {
        width: 95%;
        max-height: 86dvh;
    }

    .message {
        left: 12px !important;
        right: 12px !important;
        top: max(12px, env(safe-area-inset-top)) !important;
        max-width: none !important;
        margin: 0 auto !important;
    }

    .btn {
        min-height: 44px;
    }

    .btn-add-email,
    .btn-remove-email {
        width: 42px !important;
        height: 42px !important;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
        padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    }

    header {
        margin-bottom: 18px;
        padding: 10px 6px;
    }

    header h1 {
        font-size: 1.5em;
    }

    header p {
        font-size: 0.95em;
    }

    .current-date-text {
        font-size: 1.45em;
        letter-spacing: 0;
    }

    .current-date-label,
    .current-date-weekday {
        font-size: 0.95em;
    }

    .day-name {
        font-size: 0.74em;
    }

    .calendar-day {
        min-height: 62px;
        padding: 5px 4px;
    }

    .main-date {
        font-size: 0.92em;
    }

    .today-label,
    .guidance-mark {
        font-size: 0.52em;
        padding: 1px 4px;
    }

    .lunar-date,
    .holiday-name {
        font-size: 0.6em;
    }

    .calendar-day.today {
        transform: scale(1);
    }

    .tab-btn {
        padding: 10px 6px;
        font-size: 0.84em;
    }

    .form-tip {
        margin-top: 20px !important;
        padding: 14px !important;
    }

    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="time"],
    input[type="number"],
    input[type="date"],
    select {
        font-size: 16px;
    }
}

/* 消息提示 */
.message {
    padding: 12px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    animation: slideIn 0.3s ease;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    max-width: 400px;
}

.message.success {
    background: #4CAF50;
    color: white;
}

.message.error {
    background: #f44336;
    color: white;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    margin-top: 10px;
}

.status-badge.active {
    background: #4CAF50;
    color: white;
}

.status-badge.inactive {
    background: #f44336;
    color: white;
}

/* 表单提示 */
.form-hint {
    display: block;
    font-size: 0.85em;
    color: #999;
    margin-top: 5px;
}

.required {
    color: #f44336;
    font-weight: bold;
}

.form-tip {
    margin-top: 30px;
    padding: 20px;
    background: #f0f4ff;
    border-left: 4px solid #667eea;
    border-radius: 5px;
}

.form-tip h4 {
    color: #667eea;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.form-tip ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.form-tip li {
    padding: 5px 0;
    color: #555;
    font-size: 0.95em;
}

.form-tip p {
    color: #667eea;
    font-weight: 600;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #d0d9ff;
}

/* 表单高亮 */
.form-section.highlight {
    animation: highlight-pulse 1s ease;
}

@keyframes highlight-pulse {
    0% {
        background: #fff;
    }
    50% {
        background: #f0f4ff;
    }
    100% {
        background: #fff;
    }
}

/* 日期输入高亮 */
.form-section input[type="date"]:focus {
    background: #f9f9ff;
}

/* 输入框获得焦点的发光效果 */
input:focus {
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.3) !important;
}

/* 多邮箱输入容器 */
.emails-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.email-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.email-input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.email-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.2);
}

.btn-add-email {
    width: 45px;
    height: 45px;
    padding: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.3em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-add-email:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-remove-email {
    width: 45px;
    height: 45px;
    padding: 0;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.3em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-email:hover {
    background: #da190b;
    transform: scale(1.05);
}

@media (hover: none) and (pointer: coarse) {
    .day-tooltip {
        display: none !important;
    }

    .calendar-day:hover,
    .reminder-card:hover,
    .btn-primary:hover,
    .btn-add-email:hover,
    .btn-remove-email:hover {
        transform: none;
        box-shadow: none;
    }
}

/* iPhone 横屏优化：空间高度有限，压缩纵向占用 */
@media (max-width: 932px) and (orientation: landscape) {
    body {
        padding: 10px;
        padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    }

    header {
        margin-bottom: 10px;
        padding: 8px 6px;
    }

    header h1 {
        font-size: 1.35em;
        margin-bottom: 4px;
    }

    header p {
        font-size: 0.88em;
    }

    .current-date-display {
        padding: 10px 12px;
    }

    .current-date-text {
        font-size: 1.2em;
        margin: 4px 0;
    }

    .tab-content {
        padding: 12px 14px;
    }

    .year-selector,
    .month-selector {
        gap: 8px;
        margin-bottom: 10px;
    }

    .month-selector h2 {
        min-width: 0;
        font-size: 1.05em;
    }

    .btn-nav {
        width: 34px;
        height: 34px;
        font-size: 1em;
    }

    .calendar-container {
        padding: 8px;
    }

    .calendar-header,
    .calendar-grid {
        gap: 3px;
    }

    .day-name {
        padding: 4px 0;
        font-size: 0.72em;
    }

    .calendar-day {
        aspect-ratio: auto;
        min-height: 58px;
        padding: 4px;
    }

    .main-date {
        font-size: 0.86em;
    }

    .today-label {
        font-size: 0.52em;
        padding: 1px 4px;
    }

    .guidance-mark {
        font-size: 0.52em;
        padding: 1px 4px;
    }

    .lunar-date,
    .holiday-name {
        font-size: 0.6em;
    }

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

    .form-tip {
        margin-top: 14px;
        padding: 12px;
    }

    .message {
        left: 10px !important;
        right: 10px !important;
        top: max(10px, env(safe-area-inset-top)) !important;
        max-width: none !important;
    }

    footer {
        margin-top: 10px;
        padding: 10px 6px;
        font-size: 0.9em;
    }
}

/* iPad 通用优化 */
@media (min-width: 768px) and (max-width: 1366px) {
    body {
        padding: 18px;
        padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
    }

    .container {
        max-width: 1120px;
    }

    header h1 {
        font-size: 2.2em;
    }

    .tab-content {
        padding: 24px;
    }

    .year-selector,
    .month-selector {
        gap: 14px;
        margin-bottom: 20px;
    }

    .month-selector h2 {
        min-width: 0;
        font-size: 1.35em;
    }

    .calendar-container {
        padding: 14px;
    }

    .calendar-header,
    .calendar-grid {
        gap: 8px;
    }

    .calendar-day {
        min-height: 64px;
    }

    .calendar-day.today {
        transform: scale(1.04);
    }

    .reminders-grid {
        grid-template-columns: repeat(2, minmax(280px, 1fr));
    }

    .modal-content {
        width: min(760px, 92%);
        max-height: 84dvh;
    }
}

/* iPad 竖屏再细化 */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .tab-btn {
        padding: 14px 10px;
        font-size: 0.95em;
    }

    .calendar-day {
        min-height: 60px;
    }
}

.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    text-align: left;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.user-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    font-weight: 600;
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.22);
}

.auth-page {
    display: flex;
    align-items: center;
}

.auth-shell {
    max-width: 980px;
}

.auth-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    gap: 24px;
    align-items: stretch;
}

.auth-card {
    display: block;
}

.auth-tabs {
    margin: -30px -30px 28px;
    padding: 10px 10px 0;
    background: linear-gradient(180deg, #fbfcff 0%, #f3f6ff 100%);
}

.auth-panel {
    display: none;
}

.auth-panel.active {
    display: block;
}

.auth-form {
    display: grid;
    gap: 4px;
}

.auth-form .form-group {
    margin-bottom: 18px;
}

.auth-form .btn-primary {
    width: 100%;
    min-height: 48px;
    border-radius: 12px;
    font-weight: 700;
}

.auth-form label {
    color: #2f3654;
    font-weight: 600;
}

.auth-copy {
    background: linear-gradient(180deg, #f9fbff 0%, #f1f4fb 100%);
}

.auth-modal-content {
    width: min(620px, 92%);
    border-radius: 22px;
    max-height: min(86vh, 900px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.auth-modal-content .modal-body {
    flex: 1;
    overflow-y: auto;
}

.auth-intro {
    color: #556;
    margin-bottom: 22px;
    line-height: 1.6;
    padding: 14px 16px;
    border-radius: 14px;
    background: linear-gradient(180deg, #f6f8ff 0%, #eef2ff 100%);
    border: 1px solid #dbe3ff;
}

.password-field {
    position: relative;
}

.password-field input[type="password"],
.password-field input[type="text"] {
    padding-right: 52px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #667eea;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
}

.password-toggle:hover {
    background: rgba(102, 126, 234, 0.1);
}

.password-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.18);
}

.password-toggle[aria-pressed="true"] {
    color: #3f56d7;
}

.password-toggle-icon {
    position: relative;
    width: 20px;
    height: 12px;
    border: 2px solid currentColor;
    border-radius: 12px / 8px;
}

.password-toggle-icon::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.password-toggle[aria-pressed="true"] .password-toggle-icon::after {
    content: "";
    position: absolute;
    left: 50%;
    top: -3px;
    width: 2px;
    height: 18px;
    background: currentColor;
    border-radius: 999px;
    transform: translateX(-50%) rotate(35deg);
}

.smtp-card {
    margin-bottom: 24px;
    border: 1px solid #dfe5f5;
    background: linear-gradient(180deg, #fbfcff 0%, #f4f7ff 100%);
}

.smtp-config-form {
    margin-top: 14px;
}

.holiday-reminder-card {
    margin-bottom: 24px;
    border: 1px solid #f0d7a8;
    background: linear-gradient(180deg, #fffdf8 0%, #fff7e8 100%);
}

#holidayReminderOptions {
    transition: opacity 0.2s ease;
}

#holidayReminderOptions.is-disabled {
    opacity: 0.55;
}

.holiday-reminder-status {
    display: block;
    margin: 2px 0 12px;
    font-weight: 700;
}

.email-tools {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.btn-small {
    padding: 8px 12px;
    font-size: 0.9em;
}

.hint-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 6px;
    border-radius: 999px;
    background: #667eea;
    color: #fff;
    font-size: 12px;
    line-height: 1;
    cursor: help;
}

.hint-tooltip {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%);
    width: 280px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(24, 28, 42, 0.96);
    color: #fff;
    font-size: 12px;
    line-height: 1.6;
    text-align: left;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 20;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.hint-badge:hover .hint-tooltip,
.hint-badge:focus .hint-tooltip,
.hint-badge:focus-within .hint-tooltip {
    opacity: 1;
}

.auth-copy ul {
    padding-left: 20px;
    line-height: 1.8;
}

@media (max-width: 900px) {
    .header-bar {
        flex-direction: column;
        text-align: center;
    }

    .user-actions {
        justify-content: center;
    }

    .auth-grid {
        grid-template-columns: 1fr;
    }
}
