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

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f0f2f5;
    min-height: 100vh;
}

.schedule-page {
    min-height: 100vh;
    padding-bottom: 20px;
}

.bottom-safe {
    height: 30px;
}

.hero {
    position: relative;
    padding: 24px 16px 18px;
    overflow: hidden;
}

.hero-deco {
    position: absolute;
    border-radius: 50%;
    opacity: 0.12;
    pointer-events: none;
}

.hero-deco-1 {
    width: 130px;
    height: 130px;
    top: -50px;
    right: -20px;
    background: #fff;
}

.hero-deco-2 {
    width: 90px;
    height: 90px;
    bottom: -30px;
    left: 20px;
    background: #fff;
    opacity: 0.08;
}

.hero-deco-3 {
    width: 50px;
    height: 50px;
    top: 20px;
    left: 50%;
    background: #fff;
    opacity: 0.06;
}

.hero-inner {
    position: relative;
    z-index: 1;
}

.hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.hero-title-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hero-emoji {
    font-size: 20px;
}

.hero-title {
    font-size: 21px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 1px;
}

.hero-right {
    display: flex;
    gap: 8px;
}

.hero-badge {
    padding: 5px 12px;
    background: rgba(255,255,255,0.22);
    border-radius: 16px;
    font-size: 12px;
    color: #fff;
    font-weight: 500;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.2);
    cursor: pointer;
}

.hero-stats {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    padding: 10px 0;
    backdrop-filter: blur(4px);
}

.stat-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.stat-num {
    font-size: 17px;
    font-weight: 800;
    color: #fff;
}

.stat-label {
    font-size: 11px;
    color: rgba(255,255,255,0.75);
}

.stat-divider {
    width: 1px;
    height: 24px;
    background: rgba(255,255,255,0.2);
}

.toolbar {
    display: flex;
    align-items: center;
    margin: -8px 14px 0;
    border-radius: 8px;
    position: relative;
    z-index: 2;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    flex-wrap: wrap;
}

.toolbar-btn {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 9px 2px;
    font-size: 12px;
    font-weight: 600;
    line-height: normal;
    cursor: pointer;
}

.toolbar-icon {
    font-size: 14px;
}

.toolbar-divider {
    width: 1px;
    height: 16px;
    background: rgba(0,0,0,0.08);
}

.rest-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 14px;
    margin-top: 8px;
}

.rest-summary-title {
    font-size: 12px;
    color: #888;
    font-weight: 500;
}

.rest-summary-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.rest-summary-tag {
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 10px;
    font-weight: 600;
}

.modal-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-modal {
    width: 88%;
    background: #fff;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.theme-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
    text-align: center;
    margin-bottom: 16px;
}

.theme-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.theme-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 6px 8px;
    border-radius: 10px;
    border: 2px solid transparent;
    background: #fafafa;
    cursor: pointer;
}

.theme-card-active {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.theme-preview {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-bottom: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.theme-name {
    font-size: 11px;
    font-weight: 500;
}

.theme-check {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    color: #fff;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.edit-modal {
    width: 88%;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.edit-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 0;
}

.edit-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
}

.edit-modal-close {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #999;
    background: #f0f0f0;
    border-radius: 50%;
    cursor: pointer;
}

.edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 14px 16px;
}

.edit-card {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 10px;
    background: #f8f9fd;
    border-radius: 8px;
    border: 1px solid #eaedf5;
}

.edit-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.edit-input {
    flex: 1;
    font-size: 13px;
    color: #333;
    height: 28px;
    border: none;
    background: transparent;
    outline: none;
}

.edit-actions {
    display: flex;
    gap: 10px;
    padding: 0 16px 16px;
}

.edit-btn {
    flex: 1;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.edit-btn.cancel {
    background: #f0f1f5;
    color: #666;
}

.edit-btn.confirm {
    color: #fff;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

.batch-modal {
    width: 90%;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.batch-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 0;
}

.batch-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
}

.batch-close {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #999;
    background: #f0f0f0;
    border-radius: 50%;
    cursor: pointer;
}

.batch-body {
    padding: 14px 16px;
}

.batch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.batch-label {
    font-size: 14px;
    font-weight: 600;
    color: #444;
    flex-shrink: 0;
}

.batch-picker {
    padding: 7px 12px;
    background: #f8f9fd;
    border: 1px solid #ddd;
    border-radius: 7px;
    font-size: 13px;
    color: #333;
    font-weight: 500;
    outline: none;
}

.batch-action-group {
    display: flex;
    gap: 6px;
}

.batch-action-btn {
    padding: 7px 12px;
    background: #f0f1f5;
    border-radius: 7px;
    font-size: 12px;
    color: #666;
    font-weight: 600;
    cursor: pointer;
}

.batch-action-btn.active {
    color: #fff;
}

.batch-tip {
    font-size: 11px;
    color: #999;
    line-height: 1.6;
    padding: 0 16px 10px;
}

.batch-actions {
    display: flex;
    gap: 10px;
    padding: 0 16px 16px;
}

.month-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    margin: 10px 14px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.nav-arrow {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.nav-title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: 1px;
}

.staff-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 10px 12px;
    margin: 0 14px 10px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.staff-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 11px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 600;
}

.pill-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
}

.table-card {
    margin: 0 14px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.t-header {
    display: flex;
    padding: 0;
}

.th {
    padding: 11px 0;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.95);
    text-align: center;
}

.td-date-c {
    width: 65px;
    text-align: center;
}

.td-shift-c {
    flex: 1;
    text-align: center;
}

.td-rest-c {
    width: 65px;
    text-align: center;
}

.t-scroll {
    max-height: 700px;
    overflow-y: auto;
}

.t-row {
    display: flex;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid #f2f4f8;
    border-left: 3px solid transparent;
}

.t-row:nth-child(odd) {
    background: #fafbfe;
}

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

.t-today {
    font-weight: 700;
}

.t-rest-row {
    border-left-style: solid;
}

.td {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.d-num {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    width: 27px;
    height: 27px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.d-label {
    font-size: 10px;
    color: #aaa;
}

.tag {
    font-size: 11px;
    padding: 4px 9px;
    border-radius: 5px;
    font-weight: 600;
    letter-spacing: 0.5px;
    display: inline-block;
    margin: 2px;
}

.rest-btn {
    font-size: 12px;
    padding: 6px 7px;
    border-radius: 6px;
    font-weight: 700;
    display: inline-block;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    border: 1px solid;
    letter-spacing: 1px;
    cursor: pointer;
}

.empty-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 0;
}

.empty-emoji {
    font-size: 32px;
    margin-bottom: 8px;
}

.empty-msg {
    font-size: 13px;
    color: #999;
}

.notes-card {
    margin: 12px 14px;
    padding: 14px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.notes-head {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 8px;
}

.notes-icon {
    font-size: 15px;
}

.notes-title-text {
    font-size: 14px;
    font-weight: 700;
    color: #1a1a2e;
}

.notes-area {
    width: 100%;
    min-height: 60px;
    font-size: 13px;
    color: #333;
    padding: 8px;
    background: #f8f9fd;
    border-radius: 7px;
    line-height: 1.7;
    box-sizing: border-box;
    border: none;
    resize: vertical;
    outline: none;
}

.notes-count-wrap {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.notes-count {
    font-size: 11px;
    color: #ccc;
}

.rules-card {
    margin: 0 14px;
    padding: 14px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.rules-head {
    font-size: 13px;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 10px;
}

.rules-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.rule-row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 12px;
    color: #888;
    line-height: 1.6;
}

.rule-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    margin-top: 7px;
    flex-shrink: 0;
}

.qrcode-modal {
    width: 88%;
    max-width: 360px;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.qrcode-content {
    padding: 24px 16px;
    text-align: center;
}

.qrcode-wrapper {
    display: inline-block;
    padding: 16px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    margin-bottom: 16px;
}

#qrcode-canvas {
    width: 200px;
    height: 200px;
}

.qrcode-tip {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
}

.qrcode-url {
    font-size: 11px;
    color: #999;
    word-break: break-all;
    padding: 8px 12px;
    background: #f8f9fd;
    border-radius: 8px;
}

@media (max-width: 480px) {
    .hero {
        padding: 20px 14px 16px;
    }
    
    .hero-title {
        font-size: 20px;
    }
    
    .hero-emoji {
        font-size: 18px;
    }
    
    .stat-num {
        font-size: 15px;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    .toolbar {
        margin: -8px 12px 0;
    }
    
    .toolbar-btn {
        padding: 8px 2px;
        font-size: 11px;
    }
    
    .toolbar-icon {
        font-size: 13px;
    }
    
    .month-nav {
        margin: 10px 12px;
        padding: 8px 12px;
    }
    
    .nav-arrow {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }
    
    .nav-title {
        font-size: 15px;
    }
    
    .staff-bar {
        margin: 0 12px 10px;
        padding: 8px 10px;
    }
    
    .staff-pill {
        padding: 4px 9px;
        font-size: 11px;
    }
    
    .table-card {
        margin: 0 12px;
    }
    
    .th {
        padding: 10px 0;
        font-size: 11px;
    }
    
    .td-date-c {
        width: 55px;
    }
    
    .td-rest-c {
        width: 55px;
    }
    
    .d-num {
        font-size: 13px;
        width: 24px;
        height: 24px;
    }
    
    .d-label {
        font-size: 9px;
    }
    
    .tag {
        font-size: 10px;
        padding: 3px 6px;
        margin: 1px;
    }
    
    .rest-btn {
        font-size: 11px;
        padding: 5px 6px;
    }
    
    .notes-card {
        margin: 12px;
        padding: 14px;
    }
    
    .rules-card {
        margin: 0 12px;
        padding: 14px;
    }
    
    .section {
        margin: 14px 12px;
        padding: 16px;
    }
}

@media (max-width: 360px) {
    .toolbar-btn {
        font-size: 10px;
        padding: 7px 1px;
    }
    
    .toolbar-icon {
        font-size: 12px;
    }
    
    .th {
        font-size: 10px;
    }
    
    .tag {
        font-size: 9px;
        padding: 2px 5px;
    }
}

.rest-person-checklist {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 0 20px;
}

.rest-person-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #f8f9fd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.rest-person-item:hover {
    background: #e8f4fd;
}

.rest-person-item.selected {
    background: #dbeafe;
}

.rest-person-checkbox {
    width: 20px;
    height: 20px;
    accent-color: #3b82f6;
    cursor: pointer;
}

.rest-person-name {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: #333;
}

.batch-person-checklist {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.batch-person-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #f8f9fd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.batch-person-item:hover {
    background: #e8f4fd;
}

.batch-person-item.selected {
    background: #dbeafe;
}

.batch-person-checkbox {
    width: 16px;
    height: 16px;
    accent-color: #3b82f6;
    cursor: pointer;
}

.batch-person-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
}

.fixed-partner-bar {
    margin: -8px 12px 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
}

.fixed-partner-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fixed-partner-icon {
    font-size: 18px;
}

.fixed-partner-text {
    font-size: 13px;
    font-weight: 600;
    color: #92400e;
}

.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #d1d5db;
    transition: 0.3s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .slider {
    background: linear-gradient(135deg, #10b981, #34d399);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

