* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, 'Segoe UI', 'PingFang SC', Roboto, 'Helvetica Neue', sans-serif;
}

body {
    background: linear-gradient(145deg, #e9f3f1 0%, #d4e4e0 100%);
    min-height: 100vh;
    padding: 30px 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(2px);
    border-radius: 48px;
    box-shadow: 0 25px 45px -12px rgba(0, 32, 25, 0.35);
    overflow: hidden;
    transition: all 0.3s ease;
}

.hero {
    background: #1f6e5c;
    background-image: linear-gradient(135deg, #1f6e5c 0%, #2a8b74 100%);
    padding: 2rem 2.5rem;
    color: white;
}

.hero h1 {
    font-size: 2.2rem;
    font-weight: 600;
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.hero h1:before {
    content: "🏥";
    font-size: 2rem;
}

.hero p {
    margin-top: 10px;
    opacity: 0.85;
    font-weight: 400;
    font-size: 1rem;
}

.hero .badge {
    background: rgba(255,255,255,0.2);
    border-radius: 60px;
    padding: 5px 12px;
    font-size: 0.8rem;
    display: inline-block;
    margin-top: 12px;
}

.dashboard {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    padding: 32px 28px;
}

.booking-panel {
    flex: 2;
    min-width: 280px;
    background: #ffffff;
    border-radius: 32px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.03);
    padding: 24px 22px;
    transition: all 0.2s;
}

.info-panel {
    flex: 1.4;
    min-width: 280px;
    background: #ffffff;
    border-radius: 32px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.03);
    padding: 24px 22px;
}

.section-title {
    font-size: 1.45rem;
    font-weight: 600;
    color: #1f2e2a;
    border-left: 5px solid #2a8b74;
    padding-left: 16px;
    margin-bottom: 22px;
}

.date-selector {
    margin-bottom: 28px;
}

.date-label {
    font-weight: 500;
    color: #2c5a4f;
    margin-bottom: 8px;
    display: block;
    font-size: 0.9rem;
}

input[type="date"] {
    width: 100%;
    padding: 14px 18px;
    border: 1.5px solid #dcebe7;
    border-radius: 28px;
    font-size: 1rem;
    background: #fefefe;
    transition: 0.2s;
    cursor: pointer;
    color: #1f3e38;
    font-weight: 500;
}

input[type="date"]:focus {
    outline: none;
    border-color: #2a8b74;
    box-shadow: 0 0 0 3px rgba(42, 139, 116, 0.2);
}

.time-grid {
    margin-top: 20px;
}

.time-section {
    margin-bottom: 30px;
}

.time-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #226653;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 2px dashed #cde3dd;
    padding-bottom: 8px;
}

.slot-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.time-slot {
    background: #f4f9f7;
    border: 1px solid #cde3dd;
    border-radius: 60px;
    padding: 10px 18px;
    font-size: 1rem;
    font-weight: 500;
    color: #1f5e4e;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 85px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.time-slot:hover:not(.disabled-slot):not(.selected-slot) {
    background: #e0f0eb;
    border-color: #2a8b74;
    transform: translateY(-2px);
}

.time-slot.selected-slot {
    background: #2a8b74;
    border-color: #1f6e5c;
    color: white;
    box-shadow: 0 6px 12px rgba(42, 139, 116, 0.25);
}

.disabled-slot {
    background: #eef2f0;
    border-color: #d4dfdb;
    color: #a3bcb4;
    cursor: not-allowed;
    text-decoration: line-through;
    opacity: 0.7;
    box-shadow: none;
}

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

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #2c5a4f;
    font-size: 0.9rem;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 13px 18px;
    border: 1.5px solid #e2efe9;
    border-radius: 32px;
    font-size: 0.95rem;
    background: #fff;
    transition: 0.2s;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #2a8b74;
    box-shadow: 0 0 0 3px rgba(42,139,116,0.15);
}

.selected-time-preview {
    background: #eef6f3;
    padding: 14px 18px;
    border-radius: 28px;
    margin: 18px 0 22px 0;
    font-size: 0.95rem;
    color: #1d6b58;
    font-weight: 500;
    border-left: 4px solid #2a8b74;
}

.btn-primary {
    background: #1f6e5c;
    width: 100%;
    border: none;
    padding: 14px;
    border-radius: 40px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.btn-primary:hover {
    background: #2a8b74;
    transform: translateY(-1px);
    box-shadow: 0 12px 20px -8px rgba(31,110,92,0.4);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-secondary {
    background: #fff;
    width: 100%;
    border: 1.5px solid #1f6e5c;
    padding: 12px;
    border-radius: 40px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #1f6e5c;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
}

.btn-secondary:hover {
    background: #eef6f3;
}

.appointment-list {
    max-height: 460px;
    overflow-y: auto;
    margin-top: 12px;
}

.list-item {
    background: #f9fdfb;
    border-radius: 24px;
    padding: 14px 16px;
    margin-bottom: 14px;
    border: 1px solid #e2efe9;
    transition: 0.1s;
    position: relative;
}

.list-item:hover {
    background: #ffffff;
    border-color: #c0ddd2;
}

.appt-time {
    font-weight: 700;
    color: #1f6e5c;
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.appt-date {
    background: #e1f0ea;
    padding: 2px 10px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: normal;
    color: #226653;
}

.appt-details {
    font-size: 0.85rem;
    color: #4b6b62;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}

.delete-btn {
    background: none;
    border: none;
    color: #c07c6b;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px 8px;
    border-radius: 30px;
    transition: 0.2s;
}

.delete-btn:hover {
    background: #fbeae6;
    color: #c23d22;
}

.empty-message {
    color: #9dbeb4;
    text-align: center;
    padding: 28px 12px;
    font-style: italic;
}

hr {
    margin: 20px 0;
    border: 0;
    height: 1px;
    background: linear-gradient(to right, #e0ebe6, transparent);
}

.toast-msg {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2e2a;
    color: white;
    padding: 12px 28px;
    border-radius: 60px;
    font-size: 0.9rem;
    z-index: 1000;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    backdrop-filter: blur(8px);
    transition: opacity 0.2s;
    pointer-events: none;
    white-space: nowrap;
}

.list-item.today-highlight {
    border-left: 4px solid #1f6e5c;
    background: #f0f8f5;
}

.list-item.just-booked {
    animation: highlightPulse 2s ease;
}

@keyframes highlightPulse {
    0% { background: #d4efe4; box-shadow: 0 0 12px rgba(31,110,92,0.25); }
    100% { background: #f9fdfb; box-shadow: none; }
}

footer {
    text-align: center;
    padding: 18px;
    font-size: 0.75rem;
    color: #7d9b92;
    border-top: 1px solid #e0ece6;
    background: #fefefe;
}

.welcome-banner {
    background: #eef6f3;
    border-radius: 16px;
    padding: 12px 18px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: #1d6b58;
}

.welcome-banner .logout-link {
    color: #c07c6b;
    text-decoration: none;
    font-size: 0.85rem;
    cursor: pointer;
}

.welcome-banner .logout-link:hover {
    color: #c23d22;
    text-decoration: underline;
}

.remaining-badge {
    display: inline-block;
    background: #e1f0ea;
    color: #1d6b58;
    padding: 2px 10px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-left: 8px;
}

.status-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-booked {
    background: #e1f0ea;
    color: #1d6b58;
}

.status-cancelled {
    background: #fbeae6;
    color: #c07c6b;
}

/* ========== 平板 / 小屏适配 (≤780px) ========== */
@media (max-width: 780px) {
    body {
        padding: 12px 8px;
    }

    .container {
        border-radius: 24px;
    }

    .hero {
        padding: 1.2rem 1.2rem;
        flex-wrap: wrap !important;
        gap: 10px;
    }

    .hero h1 {
        font-size: 1.35rem;
    }

    .hero h1:before {
        font-size: 1.3rem;
    }

    .hero p {
        font-size: 0.82rem;
        margin-top: 4px;
    }

    .hero a {
        white-space: nowrap;
        font-size: 0.8rem !important;
        padding: 6px 12px !important;
    }

    /* 登录页容器顶部间距缩小 */
    .container[style*=\"margin-top\"] {
        margin-top: 30px !important;
    }

    .dashboard {
        padding: 16px 12px;
        gap: 16px;
    }

    .booking-panel,
    .info-panel {
        padding: 18px 14px;
        border-radius: 24px;
        min-width: 100%;
    }

    .section-title {
        font-size: 1.2rem;
        margin-bottom: 16px;
        padding-left: 12px;
    }

    .slot-buttons {
        gap: 10px;
    }

    .time-slot {
        padding: 10px 14px;
        font-size: 0.9rem;
        min-width: 72px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

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

    .form-group input,
    .form-group select {
        padding: 12px 16px;
        font-size: 16px;
    }

    input[type="date"] {
        padding: 12px 16px;
        font-size: 16px;
    }

    .btn-primary {
        padding: 14px;
        font-size: 1rem;
        min-height: 48px;
    }

    .btn-secondary {
        padding: 12px;
        font-size: 0.95rem;
        min-height: 44px;
    }

    .selected-time-preview {
        padding: 12px 14px;
        font-size: 0.9rem;
        margin: 14px 0 18px 0;
    }

    .appointment-list {
        max-height: 340px;
    }

    .list-item {
        padding: 12px 14px;
        border-radius: 20px;
        margin-bottom: 10px;
    }

    .appt-time {
        font-size: 0.9rem;
    }

    .welcome-banner {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        font-size: 0.85rem;
    }

    .toast-msg {
        bottom: 20px;
        left: 16px;
        right: 16px;
        transform: none;
        width: auto;
        text-align: center;
        white-space: normal;
        font-size: 0.85rem;
        padding: 12px 20px;
    }

    footer {
        padding: 14px;
        font-size: 0.7rem;
    }

    .booking-panel,
    .info-panel {
        overflow-x: auto;
    }
}

/* ========== 手机竖屏适配 (≤480px) ========== */
@media (max-width: 480px) {
    body {
        padding: 6px 4px;
    }

    .container {
        border-radius: 16px;
    }

    .hero {
        padding: 1rem 0.8rem;
        flex-wrap: wrap !important;
        gap: 8px;
    }

    .hero h1 {
        font-size: 1.15rem;
    }

    .hero h1:before {
        font-size: 1.1rem;
    }

    .hero p {
        font-size: 0.72rem;
        margin-top: 2px;
    }

    .hero .badge {
        font-size: 0.68rem;
        padding: 3px 8px;
        margin-top: 6px;
    }

    .hero a {
        white-space: nowrap;
        font-size: 0.72rem !important;
        padding: 5px 10px !important;
        border-radius: 20px !important;
    }

    /* 登录页容器顶部间距缩小 */
    .container[style*=\"margin-top\"] {
        margin-top: 20px !important;
    }

    .dashboard {
        padding: 12px 8px;
        gap: 12px;
    }

    .booking-panel,
    .info-panel {
        padding: 14px 10px;
        border-radius: 18px;
    }

    .section-title {
        font-size: 1.05rem;
        margin-bottom: 12px;
        padding-left: 10px;
        border-left-width: 4px;
    }

    .time-section h4 {
        font-size: 0.95rem;
        margin-bottom: 12px;
    }

    .slot-buttons {
        gap: 8px;
    }

    .time-slot {
        padding: 8px 12px;
        font-size: 0.82rem;
        min-width: 64px;
        min-height: 42px;
        border-radius: 50px;
    }

    .form-group label {
        font-size: 0.82rem;
    }

    .form-group input,
    .form-group select {
        padding: 11px 14px;
        font-size: 16px;
        border-radius: 24px;
    }

    input[type="date"] {
        padding: 11px 14px;
        border-radius: 24px;
    }

    .btn-primary {
        padding: 13px;
        font-size: 0.95rem;
        min-height: 48px;
        border-radius: 32px;
    }

    .btn-secondary {
        padding: 11px;
        font-size: 0.9rem;
        min-height: 42px;
        border-radius: 32px;
    }

    .selected-time-preview {
        padding: 10px 12px;
        font-size: 0.82rem;
        border-radius: 20px;
        margin: 10px 0 14px 0;
    }

    .list-item {
        padding: 10px 12px;
        border-radius: 16px;
        margin-bottom: 8px;
    }

    .appt-time {
        font-size: 0.85rem;
    }

    .appt-details {
        font-size: 0.78rem;
    }

    .appt-date {
        font-size: 0.7rem;
    }

    .delete-btn {
        font-size: 1rem;
        padding: 6px 10px;
    }

    .empty-message {
        padding: 20px 10px;
        font-size: 0.85rem;
    }

    .toast-msg {
        bottom: 12px;
        left: 10px;
        right: 10px;
        font-size: 0.8rem;
        padding: 10px 16px;
        border-radius: 40px;
    }

    .welcome-banner {
        font-size: 0.8rem;
        padding: 10px 14px;
    }
}
