:root {
    --font-std: "PingFang SC", "Microsoft YaHei", sans-serif;
    --font-num: "Inter", "Roboto", sans-serif;
    --radius: 24px;
    --safe-top: env(safe-area-inset-top);
    --safe-bottom: env(safe-area-inset-bottom);
}

/* === 主题：Dune (经典流沙) === */
[data-theme="dune"] {
    --bg-void: #050505;
    --bg-grad: radial-gradient(circle at 50% 0%, #4f3c23 0%, #050505 80%);
    --bg-panel: rgb(39 33 26 / 98%);
    --bg-cell: rgba(255, 255, 255, 0.03); 
    --cell-border: rgba(194, 168, 120, 0.1); 
    --cell-shadow: 0 2px 4px rgba(0,0,0,0.3);
    --cell-other-bg: rgba(255, 255, 255, 0.01); 
    --bg-card: rgba(255, 255, 255, 0.02);
    --bg-zodiac: rgb(167 144 91 / 10%);
    --bg-tab: rgba(30, 25, 20, 0.98);
    --text-main: #f7e5c2; 
    --text-muted: #d6c4a8; 
    --accent: #d4af37; 
    --accent-dim: rgba(212, 175, 55, 0.15);
    --accent-glow: rgba(212, 175, 55, 0.6);
    --danger: #ef4444;
    --success: #65aa0a;
    --wheel-line: rgb(255 178 110 / 26%);
    --wheel-mask: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
    --shadow-soft: 0 60px 100px -30px rgba(0,0,0,1);
    --border-soft: rgba(194, 168, 120, 0.15);
    --cell-bg-hover: rgba(212, 175, 55, 0.1);
    --hl-modal: var(--accent);
    --mask-grad-bottom: linear-gradient(to bottom, transparent, rgba(39, 33, 26, 0.95) 40%, rgba(39, 33, 26, 1));
    --mask-grad-top: linear-gradient(to top, transparent, rgba(39, 33, 26, 0.95) 40%, rgba(39, 33, 26, 1));
}

/* === 主题：Cream (皇家白瓷) === */
[data-theme="cream"] {
    --bg-void: #f2efe6;
    --bg-grad: radial-gradient(circle at 50% 0%, #ffffff 0%, #f6e7bd 100%);
    --bg-panel: rgba(255, 255, 255, 0.95);
    --bg-cell: #ffffff;
    --cell-border: rgba(0, 0, 0, 0.03);
    --cell-shadow: 0 2px 5px rgba(166, 160, 149, 0.3); 
    --cell-other-bg: rgb(108 108 108 / 5%);
    --bg-card: rgba(255, 255, 255, 0.6);
    --bg-zodiac: rgb(255 247 231 / 18%);
    --bg-tab: rgba(255, 255, 255, 0.98);
    --text-main: #59524b; 
    --text-muted: #987446; 
    --accent: #d69e2e;
    --accent-dim: rgba(214, 158, 46, 0.12);
    --accent-glow: rgba(214, 158, 46, 0.3);
    --danger: #d9534f;
    --success: #65aa0a;
    --wheel-line: rgb(102 83 7 / 12%);
    --wheel-mask: linear-gradient(to bottom, transparent 0%, rgba(255,255,255,1) 15%, rgba(255,255,255,1) 85%, transparent 100%);
    --shadow-soft: 0 20px 60px -15px rgba(143, 134, 120, 0.25);
    --border-soft: rgba(143, 134, 120, 0.15);
    --cell-bg-hover: rgba(255, 250, 240, 1);
    --hl-modal: transparent;
    --mask-grad-bottom: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.9) 40%, rgba(255, 255, 255, 1));
    --mask-grad-top: linear-gradient(to top, transparent, rgba(255, 255, 255, 0.9) 40%, rgba(255, 255, 255, 1));
}

* { margin: 0; padding: 0; box-sizing: border-box; outline: none; -webkit-tap-highlight-color: transparent; user-select: none; }
 
body {
    font-family: var(--font-std);
    background-color: var(--bg-void);
    background-image: var(--bg-grad);
    color: var(--text-main);
    min-height: 100vh;
    display: flex; justify-content: center; align-items: center; padding: 20px;
    overscroll-behavior: none; overflow-x: hidden;
    transition: background 0.6s, color 0.6s;
}

.app-container {
    width: 100%; max-width: 1350px; height: 900px; 
    background: var(--bg-panel); border-radius: var(--radius);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 0 0 1px var(--border-soft), var(--shadow-soft);
    display: grid; grid-template-columns: 1.4fr 1fr;
    overflow: hidden; position: relative; opacity: 0; transition: opacity 1s;
}

@media (max-width: 900px) {
    body { display: block; position: fixed; width: 100vw; height: 100vh; padding: 0; overflow: hidden; }
    
    .app-container { 
        display: block; width: 100vw; height: 100vh; margin: 0; border-radius: 0; box-shadow: none; border: none;
        padding-top: max(10px, var(--safe-top));
        padding-bottom: calc(70px + var(--safe-bottom)); 
        overflow: hidden;
    }

    .left-panel, .right-panel {
        position: absolute; top: 0; left: 0; width: 100%; height: 100%;
        overflow-y: auto; -webkit-overflow-scrolling: touch;
        padding: max(10px, var(--safe-top)) 15px calc(80px + var(--safe-bottom)) 15px !important;
        border: none !important; display: none; opacity: 0; transition: opacity 0.25s ease-out;
    }
    .panel-active { display: flex !important; flex-direction: column; opacity: 1; z-index: 10; }

    .header {margin-top: 10px; margin-bottom: 5px; gap: 5px; flex-shrink: 0; }
    .logo { font-size: 13px !important; letter-spacing: 1px; gap: 5px !important; } 
    .logo i { font-size: 24px !important; display: block; }
    .controls { padding: 4px 8px !important; gap: 4px !important; }
    .ym-disp { font-size: 15px !important; min-width: 80px !important; }
    .c-btn { font-size: 18px !important; padding: 4px !important; }
    
    .task-box { display: none !important; } 
    
    .cal-grid { display: grid; gap: 6px; flex: none; height: auto; margin-bottom: 20px; }
    .cell { aspect-ratio: unset !important; height: auto; min-height: 60px; border-radius: 10px; padding: 4px 0; justify-content: space-evenly; }
    .sol-n { font-size: 19px !important; margin-bottom: 0px; }
    .lunar-t, .fest-t { font-size: 11px !important; opacity: 0.9; transform: none !important; }

    #p-info { padding-top: max(20px, var(--safe-top)) !important; gap: 8px !important; }

    .clock-wrap { padding-bottom: 5px !important; margin-bottom: 0px !important; border-bottom: 1px solid var(--border-soft); }
    .t-hm { font-size: 52px !important; letter-spacing: -2px; }
    .t-s { font-size: 24px !important; }
    
    .dial { width: 60px !important; height: 60px !important; }
    .dial #ch { width: 4px !important; height: 14px !important; margin-left: -2px !important; }
    .dial #cm { width: 3px !important; height: 20px !important; margin-left: -1.5px !important; }
    .dial #cs { width: 1px !important; height: 23px !important; margin-left: -0.5px !important; }
    .dial .dot { width: 5px !important; height: 5px !important; }

    .right-panel .card { padding: 15px 14px !important; margin-bottom: 0 !important; }
    .d-full { font-size: 20px !important; margin-bottom: 2px !important; }
    .l-full { font-size: 16px !important; margin-bottom: 6px !important; }
    .yj-grid { font-size: 13px !important; gap: 6px !important; }
    .yj-badge { font-size: 11px !important; padding: 2px 0 !important; }
    .tcm-ico { font-size: 22px !important; margin-top: 0 !important; }
    .tcm-tit { font-size: 15px !important; margin-bottom: 2px !important; }
    .tcm-inf { font-size: 13px !important; line-height: 1.3 !important; }
    .z-tit { font-size: 16px !important; }
    .z-attr { margin: 4px 0 6px !important; font-size: 12px !important; }
    .z-desc { font-size: 13px !important; line-height: 1.4 !important; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
    .sx-head { margin-bottom: 5px !important; }
    .sx-trigger { padding: 4px 24px 4px 10px !important; font-size: 12px !important; }
    .sx-res { font-size: 13px !important; line-height: 1.4 !important; }
    .alarm-wrap { display: none !important; }
    .fs-tip { display: none !important; }

    .mobile-tab-bar {
        display: flex; position: fixed; bottom: 0; left: 0; width: 100%;
        height: calc(60px + var(--safe-bottom));
        background: var(--bg-tab);
        backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
        border-top: 1px solid var(--border-soft);
        z-index: 10000;
        justify-content: space-around;
        align-items: flex-start;
        padding-top: 10px;
        box-shadow: 0 -5px 20px rgba(0,0,0,0.1);
    }
    .mt-item { display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-muted); font-size: 10px; gap: 4px; width: 60px; cursor: pointer; transition: 0.3s; }
    .mt-icon { font-size: 22px; transition: 0.3s; }
    .mt-item.active { color: var(--accent); }
    .mt-item.active .mt-icon { transform: translateY(-2px); text-shadow: 0 4px 10px var(--accent-glow); }
}
 
@media (min-width: 901px) {
    .mobile-tab-bar { display: none !important; }
    .left-panel, .right-panel { display: flex !important; opacity: 1 !important; position: relative !important; top: auto !important; left: auto !important; height: auto !important; overflow: visible !important; }
}

/* 3D Wheel */
.wheel-wrapper { display: flex; justify-content: center; gap: 30px; height: 240px; position: relative; mask-image: var(--wheel-mask); -webkit-mask-image: var(--wheel-mask); }
.wheel-group { position: relative; width: 80px; height: 100%; display: flex; justify-content: center; overflow: hidden; }
.wheel-texture-background { position: absolute; top: -10px; left: 0; width: 100%; height: 110%; border-left: 3px solid var(--accent); border-right: 3px solid var(--accent); background-image: repeating-linear-gradient(to bottom, var(--wheel-line) 0px, var(--wheel-line) 1px, transparent 1px, transparent 4px); z-index: 1; pointer-events: none; }
.wheel-col { width: 100%; height: 100%; overflow-y: scroll; scroll-snap-type: y mandatory; scrollbar-width: none; z-index: 10; overflow-x: hidden; touch-action: pan-y; }
.wheel-col::-webkit-scrollbar { display: none; }
.wheel-item { width: 100%; height: 48px; line-height: 48px; text-align: center; font-family: var(--font-num); font-size: 20px; color: var(--text-muted); cursor: pointer; scroll-snap-align: center; transition: 0.2s; opacity: 0.5; transform: scale(0.9); }
.wheel-item.active { opacity: 1; color: var(--accent); transform: scale(1.35); font-weight: 700; text-shadow: 0 0 20px var(--accent-glow); }
.wheel-padding { height: 96px; }
.wheel-highlight { position: absolute; top: 50%; left: 0; right: 0; height: 48px; transform: translateY(-50%); border: none; z-index: 5; pointer-events: none; }
 
.cell.weekend {
    background: linear-gradient(to bottom right, rgba(255, 255, 255, 0.01), rgba(212, 175, 55, 0.12));
    border-color: rgba(212, 175, 55, 0.15);
}
 
[data-theme="cream"] .cell.weekend {
    background: linear-gradient(to bottom right, #ffffff, #fff8e1);
    border-color: rgba(214, 158, 46, 0.2);
}

.work-status {
    position: absolute;
    top: 4px;
    left: 6px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    z-index: 5;
    font-family: var(--font-std);
}
.status-xiu { color: #65aa0a; text-shadow: 0 0 5px rgba(101, 170, 10, 0.3); }
.status-ban { color: #ef4444; text-shadow: 0 0 5px rgba(239, 68, 68, 0.3); }
.cell.selected .status-xiu, .cell.selected .status-ban { color: #fff; text-shadow:none; opacity: 0.9; }

#loading-layer { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--bg-void); z-index: 20000; display: flex; flex-direction: column; justify-content: center; align-items: center; transition: opacity 0.6s ease-out; }
.loader-ring { width: 60px; height: 60px; border: 2px solid var(--accent-glow); border-top: 2px solid var(--accent); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 20px; }
.loading-text { font-family: var(--font-num); color: var(--accent); letter-spacing: 3px; font-size: 14px; animation: pulse 1.5s infinite; }
.error-text { display: none; color: var(--danger); margin-top: 10px; font-size: 14px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes pulse { 0% { opacity: 0.5; } 50% { opacity: 1; } 100% { opacity: 0.5; } }

/* Left Panel PC */
.left-panel { padding: 35px; display: flex; flex-direction: column; border-right: 1px solid var(--border-soft); overflow-y: auto; }
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.logo { font-size: 22px; font-weight: 800; color: var(--accent); letter-spacing: 2px; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.controls { display: flex; align-items: center; gap: 6px; background: rgba(0,0,0,0.03); padding: 4px 12px; border-radius: 50px; box-shadow: 0 0 0 1px var(--border-soft); }
.c-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 18px; padding: 4px; transition: 0.2s; }
.c-btn:hover { color: var(--accent); }
.ym-disp { font-family: var(--font-num); font-size: 18px; font-weight: 700; min-width: 90px; text-align: center; cursor: pointer; padding-top:2px; color: var(--text-main); white-space: nowrap; }
.week-head { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; color: var(--text-muted); font-size: 16px; margin-bottom: 15px; font-weight: 800; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; flex: 1; padding: 5px; } 
 
.cell { aspect-ratio: 5 / 4; background: var(--bg-cell); border-radius: 12px; cursor: pointer; border: 1px solid var(--cell-border); box-shadow: var(--cell-shadow); position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 0; transition: 0.2s; overflow: hidden; }
.cell:hover { background: var(--cell-bg-hover); transform: translateY(-2px); border-color: var(--accent); }
.cell.today { box-shadow: 0 0 0 1px var(--accent), 0 0 15px var(--accent-dim) inset; z-index:2; }
.cell.selected { background: linear-gradient(135deg, var(--accent), #b48526); color: #fff; border-color: transparent; box-shadow: 0 5px 15px -3px var(--accent-glow); transform: scale(1.05); z-index: 3; }
.cell.selected .lunar-t, .cell.selected .fest-t, .cell.selected .sol-n { color: #fff; font-weight: 900; }
.cell.other { background: var(--cell-other-bg); opacity: 0.5; pointer-events: none; filter: grayscale(0.8); }
.sol-n { font-size: 26px; font-family: var(--font-num); font-weight: 700; letter-spacing: -0.5px; line-height: 1; }
.lunar-t { font-size: 13px; opacity: 0.8; line-height: 2; }
.fest-t { font-size: 13px; color: var(--accent); font-weight: bold; transform: scale(0.9); line-height: 2; }
.selected .fest-t { color: #fff; }
.cell.has-task::after { content: ''; position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; background: var(--accent); border-radius: 50%; opacity: 0.9; box-shadow: 0 0 5px var(--accent); }
.cell.selected.has-task::after { background: #fff; }

.task-box { margin-top: 25px; border-top: 1px solid var(--border-soft); padding-top: 15px; display: flex; flex-direction: column; }
 
.task-list-wrapper {
    position: relative; 
    margin-bottom: 10px;
}

.task-list { 
    height: 120px; 
    overflow-y: auto; 
    padding-right: 5px; 
    padding-top: 10px;
    padding-bottom: 10px; 
    scroll-behavior: smooth;
    scrollbar-width: none; 
    -ms-overflow-style: none;
}
.task-list::-webkit-scrollbar { display: none; }

.more-indicator {
    position: absolute;
    left: 0;
    width: 100%;
    height: 10px; 
    display: none;
    justify-content: center;
    color: var(--accent);
    cursor: pointer;
    font-size: 24px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.more-indicator.show { opacity: 1; display: flex; pointer-events: auto; }
/* .more-indicator i { text-shadow: 0 2px 5px rgba(0,0,0,0.5); }*/

.more-indicator.down {
    bottom: 0;
    background: var(--mask-grad-bottom);
    align-items: flex-end; 
}
.more-indicator.down i { animation: bounceDown 2s infinite; padding-bottom: 15px; }

.more-indicator.up {
    top: 0;
    background: var(--mask-grad-top);
    align-items: flex-start;
}
.more-indicator.up i { animation: bounceUp 2s infinite; padding-top: 20px; }

@keyframes bounceDown {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-5px);}
    60% {transform: translateY(-3px);}
}
@keyframes bounceUp {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(5px);}
    60% {transform: translateY(3px);}
}

.task-item { font-size: 14px; padding: 12px 14px; background: rgba(0,0,0,0.03); border-left: 2px solid var(--text-muted); margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; border-radius: 6px; }
.task-item.with-alarm { border-left-color: var(--accent); }
.task-item.completed { border-left-color: var(--success); background: rgb(164 205 82 / 5%); }
.task-item.completed span { color: var(--text-muted); opacity: 0.8; }
.task-time { font-family: var(--font-num); font-size: 12px; color: var(--accent); margin-right: 6px; background: var(--accent-dim); padding: 2px 6px; border-radius: 4px; }
.task-del-btn { cursor:pointer; color:var(--danger); font-weight:900; font-size:16px; padding:5px; }
 
.inp-row { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.inp { flex: 1; background: rgba(0,0,0,0.03); box-shadow: 0 0 0 1px var(--border-soft); color: var(--text-main); padding: 10px; border-radius: 8px; font-family: inherit; border:none;}
.task-alarm-trigger { width: 44px; height: 44px; background: rgba(0,0,0,0.03); box-shadow: 0 0 0 1px var(--border-soft); border-radius: 8px; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 18px; border:none;}
.task-alarm-trigger.set { color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: var(--accent-dim); }
.add-btn { width: 44px; height: 44px; background: var(--accent); color: #fff; border: none; border-radius: 8px; cursor: pointer; font-weight: bold; display: flex; align-items: center; justify-content: center; font-size: 18px; box-shadow: 0 4px 10px var(--accent-glow); }

.right-panel { background: rgba(0,0,0,0.02); padding: 35px; display: flex; flex-direction: column; gap: 15px; overflow-y: auto; }
.clock-wrap { display: flex; justify-content: space-between; align-items: flex-end; padding-bottom: 15px; border-bottom: 1px solid var(--border-soft); }
.time-box { display: flex; align-items: baseline; white-space: nowrap; line-height: 1; }
.t-hm { font-size: 80px; font-family: var(--font-num); font-weight: 700; letter-spacing: -2px; }
.t-s { font-size: 36px; font-family: var(--font-num); color: var(--accent); margin-left: 12px; font-weight: 600; }
 
.dial { width: 85px; height: 85px; border-radius: 50%; background: radial-gradient(circle at center, #333, #000); box-shadow: 0 0 0 2px var(--border-soft), inset 0 0 15px rgba(0,0,0,0.8); position: relative; flex-shrink: 0; }
[data-theme="cream"] .dial { background: radial-gradient(circle at center, #fff, #f0f0f0); box-shadow: 0 0 0 2px var(--border-soft), inset 0 0 10px rgba(0,0,0,0.05); }
 
.hand { position: absolute; bottom: 50%; left: 50%; transform-origin: bottom center; border-radius: 4px 4px 0 0; z-index: 2; box-shadow: 0 0 4px rgba(0,0,0,0.5); }
#ch { width: 6px; height: 26px; background: #fff; margin-left: -3px; z-index: 3; }
#cm { width: 4px; height: 34px; background: var(--text-muted); margin-left: -2px; z-index: 2; }
#cs { width: 2px; height: 38px; background: var(--danger); margin-left: -1px; z-index: 4; }
.dot { width: 10px; height: 10px; background: var(--accent); border-radius: 50%; position: absolute; top:50%; left:50%; transform:translate(-50%,-50%); z-index: 5; box-shadow: 0 0 2px rgba(0,0,0,0.5); }
 
[data-theme="cream"] #ch { background: #59524b; }

.card { background: var(--bg-card); box-shadow: 0 0 0 1px var(--border-soft), var(--shadow-soft); padding: 16px; border-radius: 12px; flex-shrink: 0; }
.d-full { font-size: 26px; font-family: var(--font-num); font-weight: 700; margin-bottom: 5px; color: var(--text-main); letter-spacing: 2.5px; }
.l-full { font-size: 23px; color: var(--accent); margin-bottom: 10px; font-weight: 500; font-family: "KaiTi", serif; }
.yj-grid { display: grid; grid-template-columns: 40px 1fr; gap: 10px; font-size: 15px; align-items: start; }
.yj-badge { display: flex; justify-content: center; align-items: center; border-radius: 6px; color: #fff; font-weight: bold; font-size: 13px; padding: 4px 0; margin-top: 2px; }
.yi { background: var(--success); }
.ji { background: var(--danger); }
.yj-txt { line-height: 1.5; color: var(--text-muted); }
.tcm-row { display: flex; gap: 15px; align-items: flex-start; }
.tcm-ico { font-size: 26px; color: var(--text-muted); margin-top: 2px; }
.tcm-tit { font-size: 17px; color: var(--accent); font-weight: bold; margin-bottom: 4px; }
.tcm-inf { font-size: 14px; color: var(--text-muted); line-height: 1.5; }
.z-row { border-right: 3px solid var(--accent); padding-left: 15px; background: var(--bg-zodiac); }
.z-tit { font-size: 18px; font-weight: bold; color: var(--text-main); display: flex; justify-content: space-between; align-items: center; }
.z-date { font-size: 13px; font-family: var(--font-num); color: var(--text-muted); }
.z-attr { color: var(--accent); font-size: 13px; margin: 6px 0 8px; font-weight: 600; }
.z-desc { font-size: 14px; line-height: 1.6; color: var(--text-muted); text-align: justify; }

.sx-box.clash { box-shadow: 0 0 0 1px var(--danger); background: var(--danger-bg); }
.sx-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.sx-trigger { background: var(--bg-void); box-shadow: 0 0 0 1px var(--border-soft); color: var(--accent); padding: 6px 30px 6px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23d4af37%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E"); background-repeat: no-repeat; background-position: right 10px top 50%; background-size: 10px auto; }
.sx-res { font-size: 15px; line-height: 1.6; color: var(--text-muted); font-style: normal; }
.sx-good { color: var(--success); font-weight: bold; }
.sx-bad { color: var(--danger); font-weight: bold; }

.alarm-wrap { margin-top: auto; background: linear-gradient(90deg, var(--bg-card), rgba(0,0,0,0.02)); box-shadow: 0 0 0 1px var(--border-soft); padding: 15px 20px; border-radius: 50px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.alarm-left { display: flex; align-items: center; gap: 12px; }
.alarm-ico { font-size: 22px; color: var(--accent); }
.alarm-disp { font-family: var(--font-num); font-size: 22px; font-weight: 700; color: var(--text-main); cursor: pointer; border-bottom: 1px dashed transparent; transition: 0.3s; }
.alarm-st { font-size: 13px; padding: 10px 16px; border-radius: 20px; background: #333; color: #d4d4d4; font-weight: bold; min-width: 120px; text-align: center; transition: 0.3s; white-space: nowrap; }
.alarm-st.active { background: var(--success); color: #fff; box-shadow: 0 0 10px rgba(5, 150, 105, 0.4); }
.alarm-st.ringing { background: var(--danger); color: #fff; animation: flash 0.5s infinite; cursor: pointer; }
.fs-tip { font-size: 13px; color: var(--text-muted); text-align: center; margin-top: 5px; cursor: pointer; opacity: 0.6; transition: 0.3s; flex-shrink: 0; }

.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 12000; justify-content: center; align-items: center; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.hud-box { position: relative; background: var(--bg-panel); box-shadow: 0 20px 50px -10px rgba(0,0,0,0.5); padding: 30px; width: 90%; max-width: 380px; animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); border-radius: 24px; border: 1px solid var(--hl-modal); }
.hud-title { color: var(--accent); text-align: center; margin-bottom: 20px; font-weight: 700; font-size: 18px; letter-spacing: 1px; }
.hud-msg { font-size: 16px; margin-bottom: 25px; color: var(--text-main); text-align: center; line-height: 1.6; }
.ring-alert { z-index: 13000; }
.ring-alert .hud-box { box-shadow: 0 0 0 1px var(--danger), 0 20px 60px rgba(239, 68, 68, 0.3); border-color: var(--danger); }
.ring-alert .hud-title { color: var(--danger); animation: pulse 0.8s infinite; }
.ring-btn-stop { background: var(--danger); color: #fff; border: none; width: 100%; padding: 15px; font-size: 18px; border-radius: 12px; cursor: pointer; font-weight: bold; animation: pulse 2s infinite; }
.hud-btn-row { display: flex; gap: 15px; margin-top: 20px; }
.hud-btn { flex: 1; background: transparent; color: var(--accent); border: 1px solid var(--accent); padding: 12px; border-radius: 12px; font-weight: bold; font-size: 15px; cursor: pointer; transition: 0.3s; letter-spacing: 1px; }
.hud-btn:hover { background: var(--accent); color: #fff; box-shadow: 0 4px 15px var(--accent-glow); }
.hud-btn.cancel { border-color: var(--text-muted); color: var(--text-muted); }
.hud-btn.cancel:hover { background: var(--text-muted); color: #fff; box-shadow: none; }
.m-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 15px; }
.m-btn { padding: 10px 0; background: rgba(255,255,255,0.05); text-align: center; cursor: pointer; border-radius: 8px; font-size: 14px; transition:0.2s; color:var(--text-main); border:1px solid var(--border-soft); }
.m-btn:hover { background: var(--accent); color: #fff; font-weight: bold; border-color:var(--accent); }
.year-ctrl { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; font-size: 24px; font-weight: bold; font-family: var(--font-num); color: var(--accent); }
.yc-btn { background: none; border: none; color: var(--text-muted); font-size: 24px; cursor: pointer; padding: 0 15px; }
 
@keyframes popIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }