:root {
    --bg-image: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #f5576c 75%, #4facfe 100%);
    --bg-overlay: rgba(0, 0, 0, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(255, 255, 255, 0.35);
    --text-color: #1d1d1f;
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    --grid-gap: 18px;
    --card-radius: 22px;
    --card-bg: rgba(255, 255, 255, 0.75);
    --card-border-color: rgba(255, 255, 255, 0.4);
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    --card-hover-shadow: 0 16px 48px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    --card-hover-bg: rgba(255, 255, 255, 0.85);
    --card-shine: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.2) 50%, transparent 100%);
    --card-shine-opacity: 0.6;
    --card-backdrop: blur(24px) saturate(1.8) brightness(1.08);
    --flip-bg: rgba(255, 255, 255, 0.65);
    --flip-border: rgba(0, 0, 0, 0.06);
    --flip-divider: rgba(0, 0, 0, 0.08);
    --flip-text: #1d1d1f;
    --flip-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    --header-color: #ffffff;
    --header-shadow: 0 2px 20px rgba(0, 0, 0, 0.25);
    --search-bg: rgba(255, 255, 255, 0.85);
    --search-divider: rgba(0, 0, 0, 0.08);
    --search-text: #1d1d1f;
    --search-placeholder: rgba(29, 29, 31, 0.45);
    --search-icon: rgba(29, 29, 31, 0.55);
    --search-icon-hover: rgba(29, 29, 31, 0.85);
    --control-bg: rgba(255, 255, 255, 0.75);
    --control-color: #1d1d1f;
    --modal-bg: rgba(255, 255, 255, 0.92);
    --quote-author-color: rgba(255, 255, 255, 0.85);
}

html[data-theme="mac-dark"] {
    --bg-image: linear-gradient(135deg, #0f0c29 0%, #302b63 25%, #24243e 50%, #0f0c29 75%, #302b63 100%);
    --bg-overlay: rgba(0, 0, 0, 0.08);
    --glass-bg: rgba(30, 30, 46, 0.75);
    --glass-border: rgba(255, 255, 255, 0.12);
    --text-color: #f5f5f7;
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    --grid-gap: 18px;
    --card-radius: 22px;
    --card-bg: rgba(40, 40, 60, 0.7);
    --card-border-color: rgba(255, 255, 255, 0.1);
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    --card-hover-shadow: 0 16px 48px rgba(0, 0, 0, 0.45), 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    --card-hover-bg: rgba(50, 50, 70, 0.75);
    --card-shine: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 50%, transparent 100%);
    --card-shine-opacity: 0.5;
    --card-backdrop: blur(24px) saturate(1.4) brightness(0.95);
    --flip-bg: rgba(255, 255, 255, 0.08);
    --flip-border: rgba(255, 255, 255, 0.12);
    --flip-divider: rgba(255, 255, 255, 0.08);
    --flip-text: #f5f5f7;
    --flip-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    --header-color: #f5f5f7;
    --header-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
    --search-bg: rgba(40, 40, 60, 0.8);
    --search-divider: rgba(255, 255, 255, 0.1);
    --search-text: #f5f5f7;
    --search-placeholder: rgba(245, 245, 247, 0.45);
    --search-icon: rgba(245, 245, 247, 0.6);
    --search-icon-hover: rgba(245, 245, 247, 0.9);
    --control-bg: rgba(40, 40, 60, 0.75);
    --control-color: #f5f5f7;
    --modal-bg: rgba(30, 30, 46, 0.95);
    --quote-author-color: rgba(245, 245, 247, 0.75);
}

.hidden {
    display: none !important;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Segoe UI', 'PingFang SC', 'Helvetica Neue', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    width: 100vw;
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--text-color);
}

.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--bg-image);
    background-size: 400% 400%;
    background-position: 0% 50%;
    z-index: -1;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-overlay);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeInUp 0.6s ease-out;
}

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

html[data-theme="mac"] .container {
    animation: fadeInUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

header {
    margin-bottom: 40px;
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.datetime-container {
    margin-bottom: 35px;
    color: var(--header-color);
    text-shadow: var(--header-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.time {
    font-size: 7rem;
    font-weight: 200;
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.date {
    font-size: 1.35rem;
    margin-top: 8px;
    opacity: 0.92;
    font-weight: 400;
    letter-spacing: 0.02em;
}

html[data-theme="mac"] .datetime-container {
    margin-bottom: 40px;
}

html[data-theme="mac"] .time {
    font-size: 8rem;
    font-weight: 100;
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

html[data-theme="mac"] .date {
    font-size: 1.5rem;
    font-weight: 300;
    margin-top: 12px;
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.25);
}

/* Search Bar */
.search-container {
    width: 100%;
    max-width: 600px;
}

.search-box {
    display: flex;
    background: var(--search-bg);
    border-radius: 50px;
    padding: 6px 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-box:focus-within {
    box-shadow: 0 6px 28px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transform: scale(1.02);
}

html[data-theme="mac"] .search-box {
    border-radius: 14px;
    padding: 8px 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12), 0 1px 4px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.35);
}

html[data-theme="mac"] .search-box:focus-within {
    box-shadow: 0 8px 32px rgba(0,0,0,0.16), 0 2px 8px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    transform: scale(1.01);
}

.search-engine-select {
    border: none;
    background: transparent;
    padding: 0 15px;
    font-size: 1rem;
    cursor: pointer;
    border-right: 1px solid var(--search-divider);
    outline: none;
    color: var(--search-text);
    transition: opacity 0.2s;
}

.search-engine-select:hover {
    opacity: 0.8;
}

html[data-theme="mac"] .search-engine-select {
    font-weight: 500;
    border-right: 1px solid rgba(0, 0, 0, 0.06);
}

.search-engine-select option {
    color: var(--search-text);
    background: var(--search-bg);
}

html[data-theme="mac-dark"] .search-engine-select {
    color-scheme: dark;
}

#search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 15px;
    font-size: 1.05rem;
    outline: none;
    color: var(--search-text);
    font-weight: 400;
}

#search-input::placeholder {
    color: var(--search-placeholder);
}

html[data-theme="mac"] #search-input {
    padding: 10px 15px;
    font-size: 1rem;
    font-weight: 400;
}

#search-btn {
    border: none;
    background: transparent;
    padding: 0 22px;
    cursor: pointer;
    color: var(--search-icon);
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#search-btn:hover {
    color: var(--search-icon-hover);
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.1);
}

html[data-theme="mac"] #search-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    margin-right: 4px;
}

html[data-theme="mac"] #search-btn:hover {
    background: rgba(0, 0, 0, 0.04);
}

/* Grid Container */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    grid-auto-rows: 110px;
    gap: var(--grid-gap);
    width: 100%;
    grid-auto-flow: dense;
}

.grid-container .card {
    animation: cardFadeIn 0.5s ease-out backwards;
}

.grid-container .card:nth-child(1) { animation-delay: 0.05s; }
.grid-container .card:nth-child(2) { animation-delay: 0.1s; }
.grid-container .card:nth-child(3) { animation-delay: 0.15s; }
.grid-container .card:nth-child(4) { animation-delay: 0.2s; }
.grid-container .card:nth-child(5) { animation-delay: 0.25s; }
.grid-container .card:nth-child(6) { animation-delay: 0.3s; }
.grid-container .card:nth-child(7) { animation-delay: 0.35s; }
.grid-container .card:nth-child(8) { animation-delay: 0.4s; }
.grid-container .card:nth-child(9) { animation-delay: 0.45s; }
.grid-container .card:nth-child(10) { animation-delay: 0.5s; }
.grid-container .card:nth-child(n+11) { animation-delay: 0.55s; }

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

html[data-theme="mac"] .grid-container .card {
    animation: cardFadeIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) backwards;
}

@media (min-width: 1000px) {
    .grid-container {
        grid-template-columns: repeat(8, 1fr);
    }
}

/* Card Styles */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border-color);
    border-radius: var(--card-radius);
    padding: 16px;
    position: relative;
    box-shadow: var(--card-shadow);
    backdrop-filter: var(--card-backdrop);
    -webkit-backdrop-filter: var(--card-backdrop);
    transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1), background 280ms cubic-bezier(0.4, 0, 0.2, 1), border-color 280ms cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    user-select: none;
    color: var(--text-color);
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--card-shine);
    opacity: var(--card-shine-opacity);
    pointer-events: none;
    z-index: 0;
    border-radius: inherit;
}

.card::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    z-index: 0;
    border-radius: inherit;
    transition: opacity 0.3s ease;
}

.card:hover::after {
    opacity: 1;
}

.grid-container .card:nth-child(8n+1)::after {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.1) 100%);
}
.grid-container .card:nth-child(8n+2)::after {
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.15) 0%, rgba(245, 87, 108, 0.1) 100%);
}
.grid-container .card:nth-child(8n+3)::after {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.15) 0%, rgba(0, 242, 254, 0.1) 100%);
}
.grid-container .card:nth-child(8n+4)::after {
    background: linear-gradient(135deg, rgba(250, 112, 154, 0.15) 0%, rgba(254, 225, 64, 0.1) 100%);
}
.grid-container .card:nth-child(8n+5)::after {
    background: linear-gradient(135deg, rgba(67, 233, 123, 0.15) 0%, rgba(56, 249, 215, 0.1) 100%);
}
.grid-container .card:nth-child(8n+6)::after {
    background: linear-gradient(135deg, rgba(131, 96, 195, 0.15) 0%, rgba(255, 123, 145, 0.1) 100%);
}
.grid-container .card:nth-child(8n+7)::after {
    background: linear-gradient(135deg, rgba(255, 159, 67, 0.15) 0%, rgba(254, 202, 87, 0.1) 100%);
}
.grid-container .card:nth-child(8n)::after {
    background: linear-gradient(135deg, rgba(45, 152, 218, 0.15) 0%, rgba(133, 64, 232, 0.1) 100%);
}

html[data-theme="mac-dark"] .grid-container .card:nth-child(8n+1)::after {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.25) 0%, rgba(118, 75, 162, 0.15) 100%);
}
html[data-theme="mac-dark"] .grid-container .card:nth-child(8n+2)::after {
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.25) 0%, rgba(245, 87, 108, 0.15) 100%);
}
html[data-theme="mac-dark"] .grid-container .card:nth-child(8n+3)::after {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.25) 0%, rgba(0, 242, 254, 0.15) 100%);
}
html[data-theme="mac-dark"] .grid-container .card:nth-child(8n+4)::after {
    background: linear-gradient(135deg, rgba(250, 112, 154, 0.25) 0%, rgba(254, 225, 64, 0.15) 100%);
}
html[data-theme="mac-dark"] .grid-container .card:nth-child(8n+5)::after {
    background: linear-gradient(135deg, rgba(67, 233, 123, 0.25) 0%, rgba(56, 249, 215, 0.15) 100%);
}
html[data-theme="mac-dark"] .grid-container .card:nth-child(8n+6)::after {
    background: linear-gradient(135deg, rgba(131, 96, 195, 0.25) 0%, rgba(255, 123, 145, 0.15) 100%);
}
html[data-theme="mac-dark"] .grid-container .card:nth-child(8n+7)::after {
    background: linear-gradient(135deg, rgba(255, 159, 67, 0.25) 0%, rgba(254, 202, 87, 0.15) 100%);
}
html[data-theme="mac-dark"] .grid-container .card:nth-child(8n)::after {
    background: linear-gradient(135deg, rgba(45, 152, 218, 0.25) 0%, rgba(133, 64, 232, 0.15) 100%);
}

.card > * {
    position: relative;
    z-index: 1;
}

.card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--card-hover-shadow);
    background: var(--card-hover-bg);
}

html[data-theme="mac"] .card {
    padding: 18px;
    transition: transform 320ms cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 320ms cubic-bezier(0.25, 0.46, 0.45, 0.94), background 280ms ease;
}

html[data-theme="mac"] .card:hover {
    transform: translateY(-8px) scale(1.03);
}

html[data-theme="mac"] .card::before {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.3) 40%, transparent 70%);
    opacity: 0.5;
}

/* Card Controls */
.card-controls-group {
    position: absolute;
    top: 5px;
    right: 5px;
    display: flex;
    gap: 5px; /* Space between buttons */
    z-index: 20;
    display: none; /* Hidden by default */
}

.editing .card-controls-group {
    display: flex;
}

.card-control-btn {
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.card-control-btn:hover {
    transform: scale(1.1);
}

.card-resize-btn {
    background: rgba(52, 152, 219, 0.9);
    font-size: 14px;
}

.card-edit-btn {
    background: #f1c40f;
}

.card-remove-btn {
    background: #e74c3c;
    font-weight: bold;
    font-size: 14px;
}

.editing .card-remove-btn {
    background: transparent;
    color: #e74c3c;
    box-shadow: none;
    border-radius: 0;
    font-size: 18px;
}

.card-resize-handle {
    position: absolute;
    right: 6px;
    bottom: 6px;
    width: 18px;
    height: 18px;
    display: none;
    z-index: 19;
    cursor: nwse-resize;
    touch-action: none;
}

.card-resize-handle::before {
    content: '';
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 10px;
    height: 10px;
    border-right: 2px solid rgba(0, 0, 0, 0.35);
    border-bottom: 2px solid rgba(0, 0, 0, 0.35);
    border-radius: 2px;
}

html[data-theme="mac-dark"] .card-resize-handle::before {
    border-right-color: rgba(255, 255, 255, 0.35);
    border-bottom-color: rgba(255, 255, 255, 0.35);
}

.editing .card-resize-handle {
    display: block;
}

.editing .card {
    animation: shake 0.5s infinite alternate;
}

@keyframes shake {
    from { transform: rotate(-1deg); }
    to { transform: rotate(1deg); }
}

/* Card Sizes */
.card.size-1x1 { grid-column: span 1; grid-row: span 1; }
.card.size-1x2 { grid-column: span 1; grid-row: span 2; } /* Tall */
.card.size-2x1 { grid-column: span 2; grid-row: span 1; } /* Wide */
.card.size-2x2 { grid-column: span 2; grid-row: span 2; } /* Large Square */
.card.size-4x2 { grid-column: span 4; grid-row: span 2; } /* Very Large */

/* Specific Card Types */

/* App Icon Card (1x1 default) */
.card.app-card {
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    padding: 12px 8px;
}

.app-icon {
    font-size: 2rem;
    margin-bottom: 4px;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-name {
    font-size: 0.78rem;
    text-align: center;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.2;
    width: 100%;
    padding: 0 2px;
    font-weight: 500;
}

html[data-theme="mac"] .app-icon {
    font-size: 2.1rem;
    margin-bottom: 6px;
}

html[data-theme="mac"] .app-name {
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}

html[data-theme="mac"] .app-card {
    padding: 14px 10px;
}

html[data-theme="mac"] .app-card:hover .app-icon {
    transform: scale(1.15);
}

/* Drag and Drop Styles */
.sortable-ghost {
    opacity: 0.4;
    background: rgba(255, 255, 255, 0.2);
    border: 2px dashed rgba(255,255,255,0.5);
}

.sortable-drag {
    cursor: grabbing;
    opacity: 1;
    background: var(--glass-bg);
    transform: scale(1.05);
}

/* Widget Cards */
.widget-title {
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Todo Widget */
.todo-list {
    list-style: none;
    overflow-y: auto;
    flex: 1;
}

.todo-item {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    margin-bottom: 5px;
}

.todo-item span {
    flex: 1;
    min-width: 0;
}

.todo-item input[type="checkbox"] {
    margin-right: 8px;
}

.todo-remove-btn {
    border: none;
    background: transparent;
    color: rgba(0, 0, 0, 0.45);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0 6px;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
}

.todo-item:hover .todo-remove-btn {
    opacity: 1;
}

.todo-remove-btn:hover {
    color: rgba(0, 0, 0, 0.75);
}

html[data-theme="mac-dark"] .todo-remove-btn {
    color: rgba(245, 245, 247, 0.6);
}

html[data-theme="mac-dark"] .todo-remove-btn:hover {
    color: rgba(255, 119, 111, 0.95);
}

html[data-theme="mac-dark"] .todo-remove-btn:focus-visible {
    outline: 2px solid rgba(255, 119, 111, 0.55);
    outline-offset: 2px;
    opacity: 1;
}

.todo-item.completed span {
    text-decoration: line-through;
    opacity: 0.6;
}

.folder-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
    overflow: auto;
    align-content: flex-start;
    padding-right: 2px;
}

.folder-dropzone:empty::before {
    content: '暂无链接';
    flex: 1;
    opacity: 0.6;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.editing .folder-dropzone {
    outline: 1px dashed rgba(0, 0, 0, 0.22);
    outline-offset: 3px;
    border-radius: 10px;
    min-height: 34px;
}

body.editing .folder-dropzone.folder-dropzone-hover {
    outline-color: rgba(52, 152, 219, 0.55);
    background: rgba(52, 152, 219, 0.08);
}

html[data-theme="mac-dark"] body.editing .folder-dropzone {
    outline-color: rgba(255, 255, 255, 0.2);
}

html[data-theme="mac-dark"] body.editing .folder-dropzone.folder-dropzone-hover {
    outline-color: rgba(129, 199, 255, 0.5);
    background: rgba(129, 199, 255, 0.1);
}

body.editing .folder-item {
    cursor: grab;
}

.folder-link {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 6px 8px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.06);
    color: inherit;
    text-decoration: none;
    font-size: 0.82rem;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.folder-link:hover {
    background: rgba(0, 0, 0, 0.1);
}

html[data-theme="mac-dark"] .folder-link {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
}

html[data-theme="mac-dark"] .folder-link:hover {
    background: rgba(255, 255, 255, 0.12);
}

.folder-empty {
    flex: 1;
    opacity: 0.6;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Calendar Widget */
.calendar-widget {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 6px;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.calendar-title {
    font-size: 0.9rem;
    font-weight: bold;
}

.calendar-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.calendar-month-label {
    font-size: 0.85rem;
    color: rgba(0, 0, 0, 0.75);
    min-width: 90px;
    text-align: center;
}

.calendar-nav-btn {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.06);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-nav-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.calendar-nav-btn i {
    font-size: 0.85rem;
    color: rgba(0, 0, 0, 0.65);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-weekday {
    text-align: center;
    font-size: 0.75rem;
    color: rgba(0, 0, 0, 0.55);
}

.calendar-weekday.is-weekend {
    color: rgba(231, 76, 60, 0.85);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    flex: 1;
    align-content: start;
}

.calendar-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    gap: 6px;
}

.calendar-week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    flex: 1;
    align-content: start;
}

.calendar-week-day {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    border-radius: 6px;
    font-size: 0.9rem;
    color: rgba(0, 0, 0, 0.75);
    background: rgba(255, 255, 255, 0.35);
}

.calendar-week-day.is-weekend {
    color: rgba(231, 76, 60, 0.85);
}

.calendar-week-day.is-today {
    background: rgba(52, 152, 219, 0.18);
    color: rgba(52, 152, 219, 0.95);
    font-weight: bold;
    outline: 1px solid rgba(52, 152, 219, 0.35);
}

.calendar-agenda {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-height: 0;
}

.calendar-agenda-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.3);
    font-size: 0.85rem;
    color: rgba(0, 0, 0, 0.75);
}

.calendar-agenda-item.is-today {
    outline: 1px solid rgba(52, 152, 219, 0.35);
    background: rgba(52, 152, 219, 0.15);
    color: rgba(52, 152, 219, 0.95);
    font-weight: 600;
}

.calendar-agenda-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.calendar-agenda-weekday {
    min-width: 32px;
    color: rgba(0, 0, 0, 0.55);
}

.calendar-agenda-item.is-today .calendar-agenda-weekday {
    color: inherit;
}

.calendar-agenda-md {
    color: rgba(0, 0, 0, 0.75);
}

.calendar-agenda-item.is-today .calendar-agenda-md {
    color: inherit;
}

.calendar-dayview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 4px;
}

.calendar-day-number {
    font-size: 3.2rem;
    line-height: 1;
    font-weight: 800;
    color: rgba(0, 0, 0, 0.8);
}

.calendar-day-weekday {
    font-size: 1rem;
    color: rgba(0, 0, 0, 0.6);
}

.calendar-day-ym {
    font-size: 0.85rem;
    color: rgba(0, 0, 0, 0.55);
}

.calendar-widget.size-1x1 .calendar-title {
    display: none;
}

.calendar-widget.size-1x1 .calendar-month-label {
    min-width: auto;
}

.calendar-widget.size-1x1 .calendar-nav {
    gap: 4px;
}

.calendar-widget.size-1x2 .calendar-title {
    display: none;
}

.calendar-widget.size-2x1 .calendar-title {
    display: none;
}

.calendar-day {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    border-radius: 6px;
    font-size: 0.8rem;
    color: rgba(0, 0, 0, 0.75);
    background: rgba(255, 255, 255, 0.35);
}

.calendar-day.is-other-month {
    color: rgba(0, 0, 0, 0.35);
    background: rgba(255, 255, 255, 0.2);
}

.calendar-day.is-weekend {
    color: rgba(231, 76, 60, 0.85);
}

.calendar-day.is-other-month.is-weekend {
    color: rgba(0, 0, 0, 0.35);
}

.calendar-day.is-today {
    background: rgba(52, 152, 219, 0.18);
    color: rgba(52, 152, 219, 0.95);
    font-weight: bold;
    outline: 1px solid rgba(52, 152, 219, 0.35);
}

/* Note Widget */
.note-content {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    resize: none;
    outline: none;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--text-color);
    caret-color: var(--text-color);
}

/* Quote Section */
.quote-container {
    text-align: center;
    color: white;
    margin-top: 45px;
    padding-bottom: 25px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4), 0 0 20px rgba(0,0,0,0.2);
    opacity: 0.92;
    transition: opacity 0.3s, transform 0.3s;
    width: 100%;
    max-width: 700px;
}

.quote-container:hover {
    opacity: 1;
    transform: translateY(-2px);
}

#quote-text {
    font-size: 1.15rem;
    font-weight: 400;
    margin-bottom: 8px;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-style: italic;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4), 0 0 20px rgba(0,0,0,0.2);
    line-height: 1.6;
}

#quote-author {
    font-size: 0.92rem;
    color: var(--quote-author-color);
    font-weight: 300;
    letter-spacing: 0.02em;
}

html[data-theme="light"] .quote-container {
    color: rgba(0, 0, 0, 0.78);
    text-shadow: none;
}

html[data-theme="light"] #quote-text,
html[data-theme="light"] #quote-author {
    text-shadow: none;
}

html[data-theme="mac"] .quote-container {
    margin-top: 50px;
    text-shadow: 0 3px 12px rgba(0,0,0,0.35), 0 0 30px rgba(0,0,0,0.15);
}

html[data-theme="mac"] #quote-text {
    font-size: 1.2rem;
    font-weight: 400;
}

html[data-theme="mac"] #quote-author {
    font-size: 0.95rem;
    font-weight: 300;
}

.theme-switcher {
    position: relative;
    display: flex;
    align-items: center;
}

.theme-menu {
    position: absolute;
    right: 0;
    bottom: 60px;
    width: 150px;
    padding: 10px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 1200;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
    background: transparent;
    color: var(--text-color);
    font-size: 0.88rem;
    padding: 10px 12px;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    width: 100%;
    height: auto;
    box-shadow: none;
    white-space: nowrap;
    transition: all 0.2s ease;
    font-weight: 500;
}

.theme-option:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.02);
}

html[data-theme="mac-dark"] .theme-option:hover {
    background: rgba(255, 255, 255, 0.08);
}

.theme-option.active {
    background: rgba(52, 152, 219, 0.12);
}

.theme-swatch {
    width: 16px;
    height: 16px;
    border-radius: 5px;
    flex: 0 0 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

html[data-theme="mac-dark"] .theme-swatch {
    border: 1px solid rgba(255, 255, 255, 0.18);
}

html[data-theme="mac"] .theme-menu {
    background: rgba(255, 255, 255, 0.88);
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18), 0 4px 16px rgba(0, 0, 0, 0.12);
}

html[data-theme="mac"] .theme-option {
    padding: 9px 11px;
    border-radius: 10px;
}

html[data-theme="mac"] .theme-option:hover {
    background: rgba(0, 0, 0, 0.04);
}

html[data-theme="mac"] .theme-swatch {
    border-radius: 4px;
}

.swatch-mac-light { background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #f5576c 75%, #4facfe 100%); }
.swatch-mac-dark { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 25%, #0f3460 50%, #1a1a2e 75%, #0d0d1a 100%); }

html[data-theme="mac-dark"] .calendar-title {
    color: rgba(245, 245, 247, 0.92);
}

html[data-theme="mac-dark"] .calendar-month-label {
    color: rgba(245, 245, 247, 0.78);
}

html[data-theme="mac-dark"] .calendar-nav-btn {
    background: rgba(255, 255, 255, 0.08);
}

html[data-theme="mac-dark"] .calendar-nav-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

html[data-theme="mac-dark"] .calendar-nav-btn i {
    color: rgba(245, 245, 247, 0.78);
}

html[data-theme="mac-dark"] .calendar-weekday {
    color: rgba(245, 245, 247, 0.6);
}

html[data-theme="mac-dark"] .calendar-weekday.is-weekend {
    color: rgba(255, 119, 111, 0.9);
}

html[data-theme="mac-dark"] .calendar-day {
    color: rgba(245, 245, 247, 0.9);
    background: rgba(255, 255, 255, 0.08);
}

html[data-theme="mac-dark"] .calendar-day.is-other-month {
    color: rgba(245, 245, 247, 0.35);
    background: rgba(255, 255, 255, 0.04);
}

html[data-theme="mac-dark"] .calendar-day.is-weekend {
    color: rgba(255, 119, 111, 0.9);
}

html[data-theme="mac-dark"] .calendar-day.is-other-month.is-weekend {
    color: rgba(245, 245, 247, 0.35);
}

html[data-theme="mac-dark"] .calendar-day.is-today {
    background: rgba(52, 152, 219, 0.25);
    color: rgba(176, 214, 255, 0.98);
    outline: 1px solid rgba(52, 152, 219, 0.45);
}

html[data-theme="mac-dark"] .calendar-week-day {
    color: rgba(245, 245, 247, 0.9);
    background: rgba(255, 255, 255, 0.08);
}

html[data-theme="mac-dark"] .calendar-week-day.is-weekend {
    color: rgba(255, 119, 111, 0.9);
}

html[data-theme="mac-dark"] .calendar-week-day.is-today {
    background: rgba(52, 152, 219, 0.25);
    color: rgba(176, 214, 255, 0.98);
    outline: 1px solid rgba(52, 152, 219, 0.45);
}

html[data-theme="mac-dark"] .calendar-agenda-item {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(245, 245, 247, 0.9);
}

html[data-theme="mac-dark"] .calendar-agenda-weekday {
    color: rgba(245, 245, 247, 0.65);
}

html[data-theme="mac-dark"] .calendar-agenda-item.is-today {
    background: rgba(52, 152, 219, 0.2);
    outline: 1px solid rgba(52, 152, 219, 0.45);
    color: rgba(176, 214, 255, 0.98);
}

html[data-theme="mac-dark"] .calendar-day-number {
    color: rgba(245, 245, 247, 0.95);
}

html[data-theme="mac-dark"] .calendar-day-weekday {
    color: rgba(245, 245, 247, 0.7);
}

html[data-theme="mac-dark"] .calendar-day-ym {
    color: rgba(245, 245, 247, 0.55);
}

.clock-widget {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.clock-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-color);
    opacity: 0.9;
    text-align: center;
}

.clock-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
    min-height: 0;
}

.clock-hm,
.clock-sec {
    display: flex;
    align-items: center;
    gap: 4px;
}

.clock-date {
    font-size: 0.85rem;
    color: var(--text-color);
    opacity: 0.75;
    text-align: center;
    white-space: nowrap;
}

.flip-sep {
    font-weight: 800;
    line-height: 1;
    opacity: 0.7;
    margin: 0 -1px;
}

.flip-digit {
    position: relative;
    width: var(--flip-w, 26px);
    height: var(--flip-h, 44px);
    --flip-half-shift: 2%;
    border-radius: var(--flip-radius, 8px);
    overflow: hidden;
    perspective: 900px;
    box-shadow: var(--flip-shadow);
}

.flip-digit-top,
.flip-digit-bottom {
    position: absolute;
    left: 0;
    right: 0;
    height: 50%;
    background: var(--flip-bg);
    color: var(--flip-text);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--flip-border);
    backface-visibility: hidden;
}

.flip-digit-top {
    top: 0;
    border-bottom: 1px solid var(--flip-divider);
    transform-origin: bottom;
}

.flip-digit-bottom {
    bottom: 0;
    border-top: none;
    transform-origin: top;
}

.flip-digit-top span, .flip-digit-bottom span {
    position: absolute;
    left: 50%;
    width: 100%;
    font-size: var(--flip-font, 1.9rem);
    font-weight: 900;
    letter-spacing: 0.01em;
    height: var(--flip-h, 44px);
    line-height: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateX(-50%);
}

.flip-digit-top span {
    top: -12%;
    transform: translateX(-50%) translateY(calc(var(--flip-half-shift) * -0.3));
}

.flip-digit-bottom span {
    bottom: -10%;
    transform: translateX(-50%) translateY(calc(var(--flip-half-shift) * 0.3));
}

.flip-animate-top {
    z-index: 4;
    animation: flipTop 0.22s ease-in forwards;
}

.flip-animate-bottom {
    z-index: 5;
    transform: rotateX(90deg);
    animation: flipBottom 0.22s ease-out 0.22s forwards;
}

.flip-digit.flip-top .flip-digit-top:not(.flip-animate-top) {
    visibility: hidden;
}

.flip-digit.flip-bottom .flip-digit-bottom:not(.flip-animate-bottom) {
    visibility: hidden;
}

@keyframes flipTop {
    0% { transform: rotateX(0deg); }
    100% { transform: rotateX(-90deg); }
}

@keyframes flipBottom {
    0% { transform: rotateX(90deg); }
    100% { transform: rotateX(0deg); }
}

.clock-size-1x1 {
    --flip-w: 22px;
    --flip-h: 34px;
    --flip-font: 1.55rem;
    --flip-radius: 8px;
}

.clock-size-1x1 .clock-title,
.clock-size-1x1 .clock-sec,
.clock-size-1x1 .clock-date {
    display: none;
}

.clock-size-1x1 .clock-main {
    gap: 8px;
}

.clock-size-1x1 .flip-sep {
    font-size: 1.2rem;
}

.clock-size-1x2 {
    --flip-w: 24px;
    --flip-h: 38px;
    --flip-font: 1.8rem;
    --flip-radius: 8px;
}

.clock-size-1x2 .clock-main {
    flex-direction: column;
    gap: 10px;
}

.clock-size-1x2 .clock-sec {
    --flip-w: 20px;
    --flip-h: 32px;
    --flip-font: 1.35rem;
    gap: 6px;
}

.clock-sec-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-color);
    opacity: 0.7;
    margin-left: 4px;
}

.clock-size-1x2 .clock-sec {
    opacity: 0.9;
}

.clock-size-1x2 .clock-date {
    font-size: 0.8rem;
}

.clock-size-2x1 {
    --flip-w: 34px;
    --flip-h: 58px;
    --flip-font: 3rem;
    --flip-radius: 8px;
}

.clock-size-2x1 .clock-title {
    display: none;
}

.clock-size-2x1 .clock-date {
    display: none;
}

.clock-size-2x1 .clock-main {
    gap: 6px;
}

.clock-size-2x1 .flip-sep {
    font-size: 2.1rem;
    margin: 0 -2px;
    opacity: 0.75;
}

.clock-size-2x2 {
    --flip-w: 36px;
    --flip-h: 58px;
    --flip-font: 2.95rem;
    --flip-radius: 8px;
}

.clock-size-2x2 .clock-main {
    gap: 10px;
}

.clock-size-2x2 .clock-sec {
    --flip-w: 22px;
    --flip-h: 36px;
    --flip-font: 1.65rem;
    opacity: 0.95;
}

.clock-size-4x2 {
    --flip-w: 56px;
    --flip-h: 90px;
    --flip-font: 4rem;
    --flip-radius: 8px;
}

.clock-size-4x2 .clock-title {
    display: none;
}

.clock-size-4x2 .clock-main {
    gap: 12px;
}

.clock-size-4x2 .clock-hm,
.clock-size-4x2 .clock-sec {
    gap: 6px;
}

.clock-size-4x2 .flip-sep {
    font-size: 2.6rem;
    margin: 0 -2px;
}

.clock-size-4x2 .clock-sec {
    --flip-w: 40px;
    --flip-h: 66px;
    --flip-font: 3rem;
    opacity: 0.95;
}

.clock-size-4x2 .clock-date {
    font-size: 1rem;
}

@media (max-width: 520px) {
    .clock-size-2x1 {
        --flip-w: 28px;
        --flip-h: 48px;
        --flip-font: 2.55rem;
    }

    .clock-size-2x1 .clock-main {
        gap: 4px;
    }

    .clock-size-2x1 .flip-sep {
        font-size: 1.8rem;
        margin: 0 -2px;
    }

    .clock-size-2x2 {
        --flip-w: 32px;
        --flip-h: 52px;
        --flip-font: 2.7rem;
    }

    .clock-size-4x2 {
        --flip-w: 46px;
        --flip-h: 76px;
        --flip-font: 3.4rem;
    }
}

.clock-fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    animation: fadeIn 0.3s ease;
}

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

.clock-fullscreen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    transform: scale(0.9);
    animation: zoomIn 0.3s ease forwards;
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.clock-fullscreen .clock-main {
    gap: 20px;
}

.clock-fullscreen .clock-hm,
.clock-fullscreen .clock-sec {
    gap: 12px;
}

.clock-fullscreen .flip-sep {
    font-size: 5rem;
    margin: 0 -4px;
}

.clock-fullscreen .flip-digit {
    --flip-w: 120px;
    --flip-h: 180px;
    --flip-font: 10rem;
    --flip-radius: 12px;
    --flip-half-shift: 0.5%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.clock-fullscreen .clock-sec {
    --flip-w: 80px;
    --flip-h: 120px;
    --flip-font: 6rem;
    opacity: 0.9;
}

.clock-fullscreen .clock-date {
    font-size: 2rem;
    font-weight: 400;
    color: white;
    opacity: 0.9;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
    .clock-fullscreen .flip-digit {
        --flip-w: 80px;
        --flip-h: 120px;
        --flip-font: 6rem;
        --flip-half-shift: 0.5%;
    }

    .clock-fullscreen .flip-sep {
        font-size: 3.5rem;
    }

    .clock-fullscreen .clock-sec {
        --flip-w: 60px;
        --flip-h: 90px;
        --flip-font: 4rem;
        --flip-half-shift: 0.5%;
    }

    .clock-fullscreen .clock-date {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .clock-fullscreen .flip-digit {
        --flip-w: 60px;
        --flip-h: 90px;
        --flip-font: 4.5rem;
        --flip-half-shift: 0.5%;
    }

    .clock-fullscreen .flip-sep {
        font-size: 2.5rem;
    }

    .clock-fullscreen .clock-sec {
        --flip-w: 45px;
        --flip-h: 70px;
        --flip-font: 3rem;
        --flip-half-shift: 0.5%;
    }

    .clock-fullscreen .clock-date {
        font-size: 1.2rem;
    }
}

.schedule-widget {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    flex: 1;
}

.schedule-size-1x1,
.schedule-size-2x1,
.schedule-size-1x2 {
    gap: 0;
}

.schedule-size-1x1 .schedule-header,
.schedule-size-2x1 .schedule-header,
.schedule-size-1x2 .schedule-header {
    display: none;
}

.schedule-size-1x1 .schedule-list {
    overflow: hidden;
    justify-content: center;
}

.schedule-size-2x1 .schedule-list {
    overflow: hidden;
    justify-content: flex-start;
    gap: 4px;
    padding-right: 0;
}

.schedule-size-1x1 .schedule-left,
.schedule-size-1x2 .schedule-left {
    width: 34px;
}

.schedule-size-1x1 .schedule-row {
    padding: 6px 8px;
    gap: 6px;
    border-radius: 10px;
}

.schedule-size-2x1 .schedule-row {
    padding: 6px 8px;
    gap: 6px;
    border-radius: 10px;
}

.schedule-size-1x2 .schedule-row {
    padding: 6px 8px;
    gap: 6px;
}

.schedule-size-1x1 .schedule-list {
    gap: 4px;
    padding-right: 0;
}

.schedule-size-1x2 .schedule-list {
    gap: 4px;
    padding-right: 0;
}

.schedule-size-1x1 .schedule-period,
.schedule-size-1x2 .schedule-period {
    font-size: 0.8rem;
}

.schedule-size-1x1 .schedule-course {
    font-size: 0.85rem;
    font-weight: 700;
}

.schedule-size-1x2 .schedule-course {
    font-size: 0.85rem;
    font-weight: 700;
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.15;
}

.schedule-size-2x1 .schedule-left,
.schedule-size-2x2 .schedule-left,
.schedule-size-4x2 .schedule-left {
    width: auto;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.schedule-size-2x1 .schedule-period,
.schedule-size-2x2 .schedule-period,
.schedule-size-4x2 .schedule-period {
    font-weight: 800;
    font-size: 0.85rem;
}

.schedule-size-2x2 .schedule-time,
.schedule-size-4x2 .schedule-time {
    font-size: 0.8rem;
    opacity: 0.75;
}

.schedule-size-2x1 .schedule-time {
    font-size: 0.75rem;
    opacity: 0.75;
}

.schedule-size-2x1 .schedule-course {
    font-size: 0.9rem;
}

.schedule-size-2x1 .schedule-row,
.schedule-size-2x2 .schedule-row,
.schedule-size-4x2 .schedule-row {
    gap: 8px;
}

.schedule-size-4x2 .schedule-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding-right: 0;
}

.schedule-size-4x2 .schedule-row {
    width: 100%;
}

@media (max-width: 520px) {
    .schedule-size-4x2 .schedule-list {
        grid-template-columns: 1fr;
    }
}

.schedule-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.schedule-day-label {
    flex: 1;
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.schedule-day-btn,
.schedule-today-btn {
    border: none;
    background: rgba(0, 0, 0, 0.06);
    color: inherit;
    border-radius: 10px;
    height: 28px;
    padding: 0 10px;
    cursor: pointer;
}

.schedule-day-btn {
    width: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

html[data-theme="mac-dark"] .schedule-day-btn,
html[data-theme="mac-dark"] .schedule-today-btn {
    background: rgba(255, 255, 255, 0.08);
}

.schedule-body {
    flex: 1;
    min-height: 0;
    display: flex;
}

.schedule-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    font-size: 0.9rem;
}

.schedule-list {
    flex: 1;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 2px;
}

.schedule-row {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.06);
    min-width: 0;
}

html[data-theme="mac-dark"] .schedule-row {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.schedule-row.is-current {
    background: rgba(52, 152, 219, 0.16);
    border-color: rgba(52, 152, 219, 0.35);
}

html[data-theme="mac-dark"] .schedule-row.is-current {
    background: rgba(129, 199, 255, 0.18);
    border-color: rgba(129, 199, 255, 0.35);
}

.schedule-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 88px;
    flex: 0 0 auto;
}

.schedule-period {
    font-weight: 800;
    font-size: 0.85rem;
    line-height: 1.1;
}

.schedule-time {
    font-size: 0.76rem;
    opacity: 0.7;
    line-height: 1.1;
}

.schedule-course {
    flex: 1;
    min-width: 0;
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 520px) {
    .schedule-row {
        padding: 7px 8px;
    }

    .schedule-left {
        width: 76px;
    }

    .schedule-course {
        font-size: 0.9rem;
        font-weight: 700;
    }
}

/* Controls */
.controls {
    position: fixed;
    bottom: 25px;
    right: 25px;
    display: flex;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 22px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.controls > button,
.controls > .theme-switcher > button {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    border: none;
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 1.15rem;
    color: var(--control-color);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

#theme-btn {
    font-size: 1.05rem;
}

#theme-btn i {
    font-size: 1.05rem;
    line-height: 1;
}

.controls > button:hover,
.controls > .theme-switcher > button:hover {
    transform: translateY(-4px) scale(1.08);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.85);
}

html[data-theme="mac"] .controls {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.72);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 2px 10px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

html[data-theme="mac"] .controls > button,
html[data-theme="mac"] .controls > .theme-switcher > button {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.55);
    box-shadow: 0 2px 6px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

html[data-theme="mac"] .controls > button:hover,
html[data-theme="mac"] .controls > .theme-switcher > button:hover {
    transform: translateY(-5px) scale(1.12);
    box-shadow: 0 12px 28px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.9);
}

html[data-theme="mac-dark"] .controls {
    padding: 12px 16px;
    background: rgba(40, 40, 60, 0.8);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35), 0 2px 10px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

html[data-theme="mac-dark"] .controls > button,
html[data-theme="mac-dark"] .controls > .theme-switcher > button {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(60, 60, 80, 0.7);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    color: #f5f5f7;
}

html[data-theme="mac-dark"] .controls > button:hover,
html[data-theme="mac-dark"] .controls > .theme-switcher > button:hover {
    transform: translateY(-5px) scale(1.12);
    box-shadow: 0 12px 28px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    background: rgba(80, 80, 100, 0.8);
    color: #ffffff;
}

html[data-theme="mac-dark"] .theme-menu {
    background: rgba(40, 40, 60, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.3);
}

html[data-theme="mac-dark"] .theme-option {
    color: #f5f5f7;
}

html[data-theme="mac-dark"] .theme-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--modal-bg);
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 420px;
    position: relative;
    color: var(--text-color);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s, color 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-modal:hover {
    transform: rotate(90deg);
    background: rgba(0, 0, 0, 0.05);
}

html[data-theme="mac"] .modal-content {
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.25), 0 10px 30px rgba(0, 0, 0, 0.15);
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background: transparent;
    color: var(--text-color);
    outline: none;
    resize: vertical;
}

html[data-theme="mac-dark"] .form-group textarea {
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.form-actions {
    text-align: right;
}

.save-btn {
    padding: 10px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.save-btn:hover {
    background: #2980b9;
}
