* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: linear-gradient(145deg, #f7f0e6 0%, #e9dfd3 100%);
    font-family: 'Segoe UI', 'SF Pro Text', 'PingFang SC', Roboto, sans-serif;
    padding: 20px 16px 40px;
    min-height: 100vh;
    color: #2e241f;
}

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

.top-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
}

.view-toggle {
    display: flex;
    gap: 12px;
    background: rgba(245, 235, 220, 0.6);
    padding: 5px;
    border-radius: 60px;
    backdrop-filter: blur(4px);
}

.toggle-btn {
    background: transparent;
    border: none;
    padding: 10px 26px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    color: #b87a53;
    cursor: pointer;
    transition: 0.2s;
}

.toggle-btn.active {
    background: #d99464;
    color: white;
}

.back-today-btn {
    background: #f1e2d4;
    border: none;
    padding: 10px 24px;
    border-radius: 40px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #b45f36;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 248, 235, 0.9);
    backdrop-filter: blur(8px);
    border-radius: 80px;
    padding: 8px 12px;
    margin-bottom: 28px;
    border: 1px solid #fff6ea;
}

.nav-btn {
    background: #ffffffcc;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 40px;
    font-size: 28px;
    cursor: pointer;
    color: #c07a5b;
    transition: 0.1s;
}

.nav-btn:active {
    transform: scale(0.94);
}

.date-header {
    text-align: center;
    flex: 1;
}

.date-main {
    font-size: 1.7rem;
    font-weight: 700;
    background: linear-gradient(135deg, #e3b38b, #c2814b);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.weekday {
    font-size: 0.9rem;
    color: #b4825a;
    margin-top: 4px;
}

.tasks-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 10px;
}

.day-column {
    flex: 1;
    min-width: 260px;
    border-radius: 48px;
    padding: 18px 14px 22px;
    border: 1px solid rgba(255, 245, 225, 0.7);
    position: relative;
}

.day-column.yesterday-column {
    background: #ece3db;
}

.day-column.today-column {
    background: #fffef7;
    box-shadow: 0 20px 35px -12px rgba(110, 60, 30, 0.2);
    border: 1px solid #ffdbb5;
    transform: scale(1.01);
}

.day-column.tomorrow-column {
    background: #faf3ea;
    opacity: 0.88;
}

.column-title {
    font-size: 1.5rem;
    padding-bottom: 12px;
    margin-bottom: 18px;
    border-bottom: 3px dashed #f0cfae;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.column-title span:first-child {
    background: #e7c9ae;
    padding: 4px 14px;
    border-radius: 40px;
    font-size: 1rem;
    color: #593c2a;
}

.add-task-btn {
    background: #f3e0cf;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 30px;
    font-size: 22px;
    font-weight: bold;
    color: #b45f36;
    cursor: pointer;
    transition: 0.1s;
}

.add-task-btn:active {
    transform: scale(0.94);
}

.task-card {
    background: white;
    border-radius: 32px;
    padding: 14px 18px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    border: 1px solid #ffe1c4;
    transition: all 0.2s;
    position: relative;
}

.task-card:hover {
    background: #fff6ed;
}

.task-card.completed {
    background: #e9e0d6;
    opacity: 0.7;
}

.task-card.completed .task-text {
    text-decoration: line-through;
    color: #a48161;
}

.task-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    flex-wrap: wrap;
}

.task-text {
    font-size: 1rem;
    font-weight: 500;
    word-break: break-word;
}

.repeat-badge {
    font-size: 0.7rem;
    background: #f0e0cf;
    padding: 3px 10px;
    border-radius: 30px;
    color: #b45f36;
    font-weight: normal;
    white-space: nowrap;
}

.check-icon {
    font-size: 1.5rem;
    width: 32px;
    text-align: center;
    color: #d99464;
    margin-left: 8px;
}

.empty-msg {
    text-align: center;
    color: #cdb092;
    padding: 30px;
    background: #fff3e6;
    border-radius: 48px;
}

.modal-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: 0.2s;
}

.modal-mask.active {
    visibility: visible;
    opacity: 1;
}

.modal-container {
    background: #fff9f2;
    width: 85%;
    max-width: 420px;
    border-radius: 56px;
    padding: 24px 22px 28px;
    text-align: center;
    box-shadow: 0 30px 40px rgba(0, 0, 0, 0.2);
}

.modal-container input {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    border: 1.5px solid #f3dbc6;
    border-radius: 60px;
    margin: 8px 0 12px;
    outline: none;
    font-family: inherit;
    background: white;
}

.repeat-options {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 15px 0 20px;
    flex-wrap: wrap;
}

.repeat-option {
    background: #f3e9e0;
    border: 2px solid transparent;
    padding: 8px 20px;
    border-radius: 40px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.1s;
    color: #876b51;
}

.repeat-option.selected {
    background: #d99464;
    color: white;
    border-color: #b45f36;
}

.modal-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 12px;
}

.modal-btn {
    background: #f2e2d2;
    border: none;
    padding: 10px 24px;
    border-radius: 40px;
    font-weight: 600;
    cursor: pointer;
}

.modal-btn.confirm {
    background: #d99464;
    color: white;
}

.modal-btn.danger {
    background: #e0b49b;
    color: #8b3c1c;
}

.warning-modal .modal-container {
    max-width: 360px;
    border-left: 6px solid #e0a878;
}

.warning-msg {
    color: #b45f36;
    margin: 16px 0;
    line-height: 1.4;
    white-space: pre-line;
}

.overview-container {
    background: #fffbf4;
    border-radius: 56px;
    padding: 20px;
}

.overview-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding: 0 8px;
}

.overview-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #b96f41;
}

.stats-badge {
    background: #f0e0d0;
    padding: 8px 18px;
    border-radius: 40px;
    color: #8b5a3c;
    font-weight: 500;
}

.month-section {
    margin-bottom: 32px;
}

.month-badge {
    font-size: 1.3rem;
    font-weight: 600;
    background: #f7e5d6;
    display: inline-block;
    padding: 5px 24px;
    border-radius: 60px;
    margin-bottom: 16px;
    color: #b06439;
}

.week-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.week-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: #fff7ef;
    border-radius: 48px;
    padding: 8px 12px;
    margin-bottom: 8px;
}

.week-label {
    width: 70px;
    font-weight: 600;
    color: #c6895c;
    font-size: 0.85rem;
}

.day-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

.day-summary {
    background: white;
    border-radius: 32px;
    padding: 8px 12px;
    min-width: 70px;
    text-align: center;
    cursor: pointer;
    border: 1px solid #ffe3cf;
    transition: 0.1s;
}

.day-summary:active {
    transform: scale(0.96);
}

.day-num {
    font-weight: 700;
    font-size: 0.9rem;
}

.completion-rate {
    font-size: 0.7rem;
    color: #8fad7a;
    font-weight: 500;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #b87a53;
}

footer {
    text-align: center;
    margin-top: 40px;
    color: #cfa882;
    font-size: 0.75rem;
    cursor: pointer;
    user-select: none;
}

@media (max-width: 760px) {
    .tasks-grid {
        flex-direction: column;
    }
    .day-column.today-column {
        order: -1;
    }
    .week-row {
        flex-direction: column;
        align-items: flex-start;
    }
    .week-label {
        width: auto;
    }
    .task-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .repeat-badge {
        font-size: 0.65rem;
    }
    .top-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .back-today-btn {
        justify-content: center;
    }
}