/* --- Global Reset & Fonts --- */
@font-face {
    font-family: 'SignatureFont';
    src: url('/fonts/xiaodoudao.ttf');
}

:root {
    /* 浅色主题（参考iOS 16浅色模式） */
    /* 基础颜色 */
    --bg-color: #f5f5f7;
    --sheet-bg: #f0eff5;
    --accent-color: #ff693c;
    --text-color: #000000;
    --secondary-text: #8e8e93;
    --border-color: #c6c6c8;

    /* 选项项颜色 */
    --option-bg: #ffffff;
    --option-bg-hover: #f8f8f8;
    --option-bg-active: #ffffff;
    --option-border: #e0e0e0;
    --option-border-hover: #d0d0d0;

    /* 输入框颜色 */
    --input-bg: #ffffff;
    --input-border: #e0e0e0;

    /* 按钮颜色 */
    --btn-bg: #ffffff;
    --btn-bg-hover: #f8f8f8;
    --btn-border: #e0e0e0;

    /* 切换开关颜色 */
    --switch-bg: #bdbdbf;

    /* 阴影 */
    --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --box-shadow-light: 0 2px 8px rgba(0, 0, 0, 0.05);
    --box-shadow-strong: 0 2px 8px rgba(0, 0, 0, 0.2);

    /* 布局参数 */
    --nav-height: 74px;
    --safe-area-bottom: env(safe-area-inset-bottom, 10px);
}

/* 深色主题（参考iOS 16深色模式） */
.dark-theme {
    /* 基础颜色 */
    --bg-color: #000;
    --sheet-bg: #1c1c1e;
    --text-color: #fff;
    --secondary-text: #8e8e93;
    --border-color: #333;

    /* 选项项颜色 */
    --option-bg: #2c2c2e;
    --option-bg-hover: #3a3a3c;
    --option-bg-active: #333;
    --option-border: #444;
    --option-border-hover: #666;

    /* 输入框颜色 */
    --input-bg: #1c1c1e;
    --input-border: #444;

    /* 按钮颜色 */
    --btn-bg: #333;
    --btn-bg-hover: #444;
    --btn-border: #444;

    /* 切换开关颜色 */
    --switch-bg: #444;

    /* 阴影 */
    --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --box-shadow-light: 0 2px 8px rgba(0, 0, 0, 0.1);
    --box-shadow-strong: 0 2px 8px rgba(0, 0, 0, 0.4);
}

body {
    margin: 0;
    padding: 0;
    background: var(--bg-color);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    overflow: hidden;
    /* Prevent body scroll */
    height: 100dvh;
    width: 100dvw;
    display: flex;
    flex-direction: column;
    user-select: none;
    -webkit-user-select: none;
}

/* --- Header Branding --- */
.header-section {
    padding: 12px 20px 5px;
    /* Reduced from 20px 20px 10px */
    text-align: center;
    background: var(--bg-color);
    position: relative;
    flex-shrink: 0;
    /* background: #0169d9; */
    transition: opacity 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.header-section h1 {
    font-weight: 900;
    letter-spacing: -1.2px;
    margin: 0 0 4px 0;
    font-size: 1.6rem;
    /* Reduced from 2.2rem */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-color);
}

#animated-title {
    transition: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.2s ease-in-out;
    opacity: 1;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    vertical-align: middle;
    overflow: hidden;
    white-space: nowrap;
    height: 1.2em;
    cursor: pointer;
    color: var(--accent-color);
}

#ruler {
    visibility: hidden;
    position: absolute;
    white-space: nowrap;
    font-weight: 900;
    font-size: 1.8rem;
    /* Matched with h1 (Reduced from 2.2rem) */
    letter-spacing: -1.2px;
    pointer-events: none;
}

.title-dot {
    width: 20px;
    /* Reduced from 24px */
    height: 20px;
    /* Reduced from 24px */
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.title-dot.white {
    background: var(--text-color);
}

.title-dot.orange {
    background: var(--accent-color);
}

.title-dot.gray {
    background: var(--option-border);
}

.subtitle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

p.subtitle {
    color: var(--secondary-text);
    text-align: center;
    line-height: 1.3;
    font-size: 0.8rem;
    /* Reduced from 0.9rem */
    margin: 0;
}

.info-btn {
    background: none;
    border: 1px solid var(--option-border);
    color: var(--secondary-text);
    border-radius: 9999px;
    width: 15px;
    height: 15px;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-family: serif;
    font-weight: bold;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.info-btn:active {
    border-color: var(--accent-color);
    transform: scale(0.95);
    color: var(--accent-color);
}

.theme-toggle-btn {
    background: none;
    /* border: 1px solid var(--option-border); */
    color: var(--secondary-text);
    border-radius: 9999px;
    width: 15px;
    height: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    position: absolute;
    right: 20px;
}

.theme-toggle-btn svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
}

.theme-toggle-btn .moon-icon {
    opacity: 0;
}

.theme-toggle-btn .sun-icon {
    opacity: 1;
}

.dark-theme .theme-toggle-btn .moon-icon {
    opacity: 1;
}

.dark-theme .theme-toggle-btn .sun-icon {
    opacity: 0;
}

.theme-toggle-btn:active {
    border-color: var(--accent-color);
    transform: scale(0.95);
    color: var(--accent-color);
}

/* 深色主题下的按钮 */
.dark-theme .info-btn {
    border: 1px solid var(--option-border);
    color: var(--secondary-text);
}

/* --- Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal {
    background: var(--sheet-bg);
    border: 1px solid var(--border-color);
    padding: 25px;
    border-radius: 20px;
    width: 85%;
    max-width: 320px;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    max-height: 80vh;
    overflow-y: auto;
}

.modal h3 {
    margin-top: 0;
    color: var(--text-color);
    text-align: center;
    font-size: 1.2rem;
}

.color-legend {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.9rem;
    color: var(--secondary-text);
    line-height: 1.4;
}

.dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.dot.white {
    background: var(--text-color);
    border: 1px solid var(--option-border);
}

.dot.orange {
    background: var(--accent-color);
    box-shadow: 0 0 8px rgba(255, 105, 60, 0.6);
}

.dot.yellow {
    background: #ffd700;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

.dot.gray {
    background: var(--option-bg);
}

.close-modal {
    background: var(--btn-bg);
    border: none;
    color: var(--text-color);
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    margin-top: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
}

.close-modal:active {
    background: var(--btn-bg-hover);
}

/* --- Main Layout --- */
#app-container {
    flex-grow: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* --- Preview Area --- */
#preview-area {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding-bottom: calc(var(--nav-height) + var(--safe-area-bottom));
    overflow: hidden;
    background: var(--bg-color);
    padding-bottom: calc(var(--nav-height) + var(--safe-area-bottom));
    /* background: #32d74b; */
    /* height: 100%; */
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}



/* iPhone Mockup (Scaled) */
.iphone-mockup {
    height: 80vh;
    /* Base height relative to viewport */
    aspect-ratio: 9 / 19.5;
    max-height: 92%;
    /* Maximum height to fit within preview-area */
    max-width: 95%;
    /* Maximum width to fit within preview-area */
    background: #000;
    border-radius: 48px;
    border: 10px solid #1a1a1a;
    position: relative;
    box-shadow:
        0 0 0 2px #333,
        /* Outer frame ring */
        0 15px 30px rgba(0, 0, 0, 0.4);
    /* Drop shadow */
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 10;
    transform-origin: top center;
    /* transform: scale(1) translateY(0); */

    /* position: fixed; */
    /* left: 50%;
    top:0px;
    transform: translate(-50%, -50%); */
}


/* 6.9英寸 - iPhone 16/17 Pro Max 视口高度 (约780-850px) */
/* preview-area高度: ~680px, iPhone高度: 650px, 缩小后: 487.5px */
/* translateY = -(680/2 - 487.5/2) = -96px */
@media (min-height: 780px) {

    /* .header-section{background-color: #ee7d7d;} */
    .iphone-mockup {
        height: 90vh;
        transform: scale(1);
        border-radius: 52px;
        border: 8px solid #1a1a1a;
    }

    .dynamic-island {
        width: 90px;
        height: 26px;
        border-radius: 22px;
    }
}

/* 6.7英寸 - iPhone 12-15 Pro Max/Plus, iPhone 14 Plus 视口高度 (约700-780px) */
/* preview-area高度: ~600px, iPhone高度: 560px, 缩小后: 420px */
/* translateY = -(600/2 - 420/2) = -90px */
@media (min-height: 700px) and (max-height: 779px) {

    /* .header-section{background-color: #ee7d7d;} */
    .iphone-mockup {
        height: 85vh;
        transform: scale(1);
        border-radius: 48px;
        border: 7px solid #1a1a1a;
    }

    .dynamic-island {
        width: 85px;
        height: 24px;
        border-radius: 20px;
    }
}

/* 6.3英寸 - iPhone 16/17 Pro 视口高度 (约650-700px) */
/* preview-area高度: ~520px, iPhone高度: 480px, 缩小后: 360px */
/* translateY = -(520/2 - 360/2) = -80px */
@media (min-height: 650px) and (max-height: 699px) {

    /* .header-section{background-color: #8dc2ff;} */
    .iphone-mockup {
        height: 80vh;
        transform: scale(1);
        border-radius: 46px;
        border: 7px solid #1a1a1a;
    }

    .dynamic-island {
        width: 80px;
        height: 24px;
        border-radius: 20px;
    }
}

/* 6.1英寸 - iPhone 12-15 标准版/Pro 视口高度 (约600-650px) */
/* preview-area高度: ~450px, iPhone高度: 420px, 缩小后: 315px */
/* translateY = -(450/2 - 315/2) = -67px */
@media (min-height: 600px) and (max-height: 649px) {

    /* .header-section{background-color: #8dff93;} */
    .iphone-mockup {
        height: 75vh;
        transform: scale(1);
        border-radius: 44px;
        border: 6px solid #1a1a1a;
    }

    .dynamic-island {
        width: 75px;
        height: 22px;
        border-radius: 18px;
    }
}

/* 5.4英寸 - iPhone 12/13 mini 视口高度 (约550-600px) */
/* preview-area高度: ~380px, iPhone高度: 350px, 缩小后: 262.5px */
/* translateY = -(380/2 - 262.5/2) = -58px */
@media (min-height: 550px) and (max-height: 599px) {
    .iphone-mockup {
        height: 70vh;
        transform: scale(1);
        border-radius: 40px;
        border: 4px solid #1a1a1a;
    }

    .dynamic-island {
        width: 65px;
        height: 20px;
        border-radius: 16px;
    }
}

/* 更小屏幕 视口高度 (<550px) */
@media (max-height: 549px) {
    .iphone-mockup {
        height: 65vh;
        transform: scale(1);
        border-radius: 36px;
        border: 4px solid #1a1a1a;
    }

    .dynamic-island {
        width: 60px;
        height: 18px;
        border-radius: 14px;
    }
}

.dynamic-island {
    width: 80px;
    height: 24px;
    background: #000;
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 20px;
    z-index: 10;
}

.mockup-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

#bg-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    display: none;
    /* Ensure smooth filter transitions in Safari */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

#mockup-img {
    position: relative;
    z-index: 2;
}

/* --- Bottom Navigation --- */
#bottom-nav {
    position: fixed;
    bottom: calc(16px + var(--safe-area-bottom));
    left: 50%;
    transform: translateX(-50%);
    width: 85%;
    max-width: 340px;
    height: 54px;
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 30px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 8px;
    z-index: 200;
    box-sizing: border-box;
}

/* 深色主题下的底部导航 */
#bottom-nav {
    background: linear-gradient(135deg, rgba(28, 28, 30, 0.7) 0%, rgba(32, 32, 34, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.7) 0%, rgba(242, 242, 247, 0.8) 100%);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* 深色主题下的底部导航 */
.dark-theme #bottom-nav {
    background: linear-gradient(135deg, rgba(28, 28, 30, 0.7) 0%, rgba(44, 44, 46, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.1);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 9px;
    background: none;
    border: none;
    cursor: pointer;
    width: auto;
    flex: 1;
    height: 100%;
    transition: all 0.2s;
    border-radius: 20px;
}

.nav-item:active {
    background: rgba(255, 255, 255, 0.1);
}

.nav-item:active .nav-icon {
    color: #ff693c;
}

.nav-item.active {
    color: #ff693c;
}

.nav-item.active .nav-icon {
    color: var(--accent-color);
    transform: scale(1.1);
}

.nav-icon {
    transition: transform 0.2s, color 0.2s;
    color: var(--secondary-text);
}

.nav-icon svg {
    fill: currentColor;
}

/* 深色主题下的导航项 */
.dark-theme .nav-item:active {
    background: rgba(255, 255, 255, 0.1);
}

.dark-theme .nav-icon {
    color: var(--secondary-text);
}

/* --- Bottom Sheet --- */
#bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 75%;
    /* Initial max height, will be dynamic */
    background: var(--sheet-bg);
    border-radius: 20px 20px 0 0;
    z-index: 300;
    transform: translateY(100%);
    /* Hidden by default */
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    will-change: transform, height;
    touch-action: none;
    /* Prevent browser handling of touch */
}

/* 底部抽屉默认样式（浅色主题） */
#bottom-sheet {
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
}

/* 深色主题下的底部抽屉 */
.dark-theme #bottom-sheet {
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
}

#sheet-handle-area {
    width: 100%;
    height: 34px;
    /* Increased slightly to provide overlap padding */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: grab;
    flex-shrink: 0;
    touch-action: none;
    background: var(--sheet-bg);
    border-radius: 20px 20px 0 0;
    position: relative;
    z-index: 301;
    box-shadow: 0 1px 0 var(--sheet-bg);
    /* Use shadow to "bleed" color down into the content area */
}

#sheet-handle {
    width: 40px;
    height: 5px;
    background: #a7a7a7;
    border-radius: 3px;
}

.dark-theme #sheet-handle {
    background: var(--option-border)
}

#sheet-content {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 16px 20px 16px;
    -webkit-overflow-scrolling: touch;
    position: relative;
    background: var(--sheet-bg);
    /* Ensure solid background */
}

/* Sheet Overlay (to close) */
#sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 250;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

#sheet-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* --- Common UI Components --- */
h2 {
    font-size: 0.85rem;
    color: var(--secondary-text);
    margin: 16px 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

h2:first-child {
    margin-top: 5px;
}

.control-group {
    /*background: #2c2c2e; border-radius: 12px; padding: 15px; */
    margin-bottom: 12px;
}

/* Theme Grid */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.theme-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.theme-preview {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border 0.2s;
    position: relative;
}

.theme-item.active .theme-preview {
    border-color: var(--accent-color);
}

.theme-item span {
    font-size: 10px;
    color: var(--secondary-text);
    font-weight: 600;
    transition: color 0.2s;
}

.theme-item.active span {
    color: var(--text-color);
}

/* 浅色主题下的主题项 */
.dark-theme .theme-item.active span {
    color: var(--text-color);
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5px;
    padding: 3px;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

.preview-dot {
    width: 100%;
    height: 100%;
    border-radius: 1.5px;
    opacity: 0.8;
}

/* 共用选项项样式 */
.option-item {
    background: var(--option-bg);
    border: 1px solid var(--option-border);
    border-radius: 10px;
    padding: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    cursor: pointer;
    transition: all 0.2s;
    height: 50px;
    color: var(--secondary-text);
    font-size: 10px;
    font-weight: 600;
}

.option-item:hover {
    border-color: var(--option-border-hover);
    background: var(--option-bg-hover);
}

.option-item.active {
    border-color: var(--accent-color);
    background: var(--option-bg-active);
    color: var(--accent-color);
}

/* Shape Grid */
.shape-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-bottom: 16px;
}

.shape-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-text);
}

.shape-item.active .shape-icon {
    color: #ff693c;
}

/* .light-theme .shape-icon { color: var(--text-color); } */

.shape-preview-circle {
    width: 18px;
    height: 18px;
    background: currentColor;
    border-radius: 50%;
}

.shape-preview-rounded {
    width: 18px;
    height: 18px;
    background: currentColor;
    border-radius: 4px;
}

.shape-preview-star {
    width: 20px;
    height: 20px;
    background: currentColor;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.shape-preview-heart {
    width: 20px;
    height: 18px;
    background: currentColor;
    clip-path: path('M10 18.35L8.55 17.03C3.4 12.36 0 9.28 0 5.5C0 2.42 2.42 0 5.5 0C7.24 0 8.91 0.81 10 2.09C11.09 0.81 12.76 0 14.5 0C17.58 0 20 2.42 20 5.5C20 9.28 16.6 12.36 11.45 17.04L10 18.35Z');
    transform: scale(0.9);
}

.shape-preview-date {
    font-size: 16px;
    font-weight: bold;
    font-family: monospace;
    color: currentColor;
}

/* Calendar Mode Grid */
.calendar-mode-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    margin-bottom: 16px;
}

.calendar-mode-item {
    text-align: center;
}

.calendar-mode-item.active .mode-icon {
    color: #ff693c;
}

/* Mode Icons */
.mode-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-text);
    transition: color 0.2s;
}

/* .light-theme .mode-icon { color: var(--text-color); } */

.icon-year {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5px;
    width: 20px;
    height: 20px;
}

.icon-year i {
    background: currentColor;
    border-radius: 0.5px;
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

.icon-segregated {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5px;
    width: 20px;
    height: 20px;
}

.icon-segregated i {
    border: 1px solid currentColor;
    border-radius: 1px;
    box-sizing: border-box;
}

.icon-quarter {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
    width: 20px;
    height: 20px;
}

.icon-quarter i {
    border: 1.5px solid currentColor;
    border-radius: 1.5px;
    box-sizing: border-box;
}

.icon-month {
    width: 18px;
    height: 20px;
    border: 1.5px solid currentColor;
    border-radius: 2px;
    position: relative;
    box-sizing: border-box;
}

.icon-month::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: currentColor;
}

.icon-month::after {
    content: '•••\A •••';
    white-space: pre;
    position: absolute;
    top: 7px;
    left: 0;
    right: 0;
    font-size: 6px;
    line-height: 4px;
    text-align: center;
    letter-spacing: 0.5px;
    color: currentColor;
}

.icon-fortnight {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 20px;
    justify-content: center;
}

.icon-fortnight i {
    height: 1.5px;
    width: 100%;
    background: repeating-linear-gradient(90deg, currentColor 0, currentColor 2px, transparent 2px, transparent 4px);
}

/* Toggle & Controls */
.toggle-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--option-bg);
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--option-border);
    margin-bottom: 16px;
}

.toggle-label {
    font-size: 13px;
    font-weight: 500;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--switch-bg);
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--accent-color);
}

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

/* Inputs */
input[type="text"],
input[type="date"],
select {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--text-color);
    padding: 0 10px;
    height: 40px;
    line-height: 38px;
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
    font-size: 14px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

input[type="text"]:focus,
input[type="date"]:focus {
    border-color: var(--accent-color);
}

/* Date Input Placeholder Hack */
input[type="date"] {
    position: relative;
}

input[type="date"]:invalid::-webkit-datetime-edit {
    color: transparent;
}

input[type="date"]:invalid::before {
    content: attr(placeholder);
    color: var(--secondary-text);
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 14px;
    line-height: normal;
}

input[type="date"]:focus::-webkit-datetime-edit {
    color: var(--text-color);
}

input[type="date"]:focus::before {
    display: none;
}

/* Date Placeholder Label */
.date-placeholder {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-text);
    pointer-events: none;
    font-size: 14px;
    z-index: 0;
}

/* Mobile Safari Fix */
@media screen and (max-width: 768px) {
    input[type="date"] {
        -webkit-appearance: none;
        appearance: none;
    }

    input[type="date"]::-webkit-calendar-picker-indicator {
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1;
    }
}

/* Signature Input */
#signature {
    font-family: 'SignatureFont', cursive;
    font-size: 20px;
    height: 52px;
    line-height: 52px;
    padding: 10px 8px;
    letter-spacing: 1px;
    width: 100%;
    background: var(--option-bg);
    border: 1px solid var(--option-border);
    border-radius: 8px;
    color: var(--text-color);
    box-sizing: border-box;
    outline: none;
}

#signature::placeholder {
    font-family: -apple-system, sans-serif;
    font-size: 13px;
    opacity: 0.5;
    padding-top: 5px;
}

/* Buttons */
.btn-add {
    background: transparent;
    border: 1px dashed var(--option-border);
    color: var(--secondary-text);
    width: 100%;
    padding: 6px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.btn-add:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* Color Options (for Weekend) */
.color-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.color-option {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.color-option.selected {
    border-color: var(--text-color);
    box-shadow: 0 0 10px rgba(255, 255, 255, .5);
    transform: scale(1.1);
    transition: all 0.2s;
}

/* Toggle Row (Deprecated by toggle-container but kept for compatibility if needed) */
.toggle-row {
    display: none;
}

/* Color Picker */
.color-picker-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.color-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.color-picker-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
}

.color-picker-desc {
    font-size: 11px;
    color: var(--secondary-text);
    font-weight: 400;
}

/* Color Input */
input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    overflow: hidden;
    padding: 0;
    background: none;
    cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: 2px solid var(--input-border);
    border-radius: 50%;
}

input[type="color"]::-moz-color-swatch {
    border: 2px solid var(--input-border);
    border-radius: 50%;
}

/* Swap Colors Button */
.swap-colors-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: var(--option-bg-hover);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    color: var(--text-color);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: auto;
    margin-right: 10px;
}

.swap-colors-btn:hover {
    background: var(--input-border);
}

.swap-colors-btn:active {
    transform: scale(0.95);
}

.swap-colors-btn svg {
    flex-shrink: 0;
}

/* Range Slider */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 32px;
    /* Increased height for better touch area */
    background: transparent;
    outline: none;
    margin: 5px 0;
    accent-color: var(--accent-color);
    --range-progress: 0%;
}

/* Webkit Track */
input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: linear-gradient(to right, var(--accent-color) 0%, var(--accent-color) var(--range-progress), var(--border-color) var(--range-progress), var(--border-color) 100%);
    border-radius: 3px;
}

/* Webkit Thumb */
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    background: var(--option-bg);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--box-shadow-strong);
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    margin-top: -11px;
    /* Centers thumb on track ( (6-28)/2 ) */
}

/* Firefox Track */
input[type="range"]::-moz-range-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: var(--option-bg);
    border-radius: 3px;
}

/* Firefox Thumb */
input[type="range"]::-moz-range-thumb {
    width: 28px;
    height: 28px;
    background: var(--option-bg);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--box-shadow-strong);
    border: 0.5px solid rgba(0, 0, 0, 0.1);
}

/* 深色主题下的滑块 */
.dark-theme input[type="range"]::-webkit-slider-thumb {
    box-shadow: var(--box-shadow-strong);
    background: var(--text-color);
}

.dark-theme input[type="range"]::-moz-range-thumb {
    box-shadow: var(--box-shadow-strong);
    background: var(--text-color);
}

/* Firefox Progress */
input[type="range"]::-moz-range-progress {
    background-color: var(--accent-color);
    height: 6px;
    border-radius: 3px;
}

/* Button */
.btn-primary {
    background: var(--accent-color);
    color: var(--text-color);
    border: none;
    padding: 15px;
    border-radius: 12px;
    width: 100%;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
}

.btn-primary:active {
    opacity: 0.8;
}

.btn-secondary {
    padding: 12px;
    width: 100%;
    font-size: 14px;
    margin-top: 10px;
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-color);
    white-space: nowrap;
    font-weight: bold;
    transition: background 0.2s;
}

/* Date List */
.date-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.date-picker-group select {
    height: 46px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    color: var(--text-color);
    padding: 0 2px;
    font-size: 13px;
    flex: 1;
    text-align: center;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
}

.date-picker-group select:focus {
    border-color: var(--accent-color);
}

.btn-remove {
    width: 28px;
    height: 28px;
    background: var(--btn-bg);
    border-radius: 50%;
    border: none;
    color: #ff453a;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
}

/* Emoji Picker */
.emoji-picker-container {
    position: relative;
    display: flex;
    align-items: center;
}

.emoji-trigger {
    height: 38px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    text-align: center;
    font-size: 20px;
    cursor: pointer;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.emoji-trigger:active {
    background: var(--option-bg);
    transform: scale(0.95);
}

.emoji-picker-panel {
    position: fixed;
    /* Fix to viewport to avoid being clipped by sheet overflow */
    bottom: 56px;
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    /* Standard width for 8 columns (8 * 30 + gaps) */
    background: rgba(255, 255, 255, 0.95);
    /* White with transparency */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 12px;
    display: none;
    z-index: 10000;
    /* High z-index to stay above sheet */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Bubble Arrow */
.emoji-picker-panel::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: var(--arrow-left, 50%);
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.95);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.emoji-picker-panel.show {
    display: block;
}

.emoji-item {
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    border-radius: 8px;
    transition: background 0.2s;
    color: #000;
}

.emoji-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.emoji-item.active {
    background: var(--accent-color);
    color: var(--text-color);
}

/* Countdown Toggle */
.countdown-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
}

.countdown-toggle-wrapper .switch {
    width: 40px;
    height: 24px;
}

/* Sub-tabs for Color */
.sub-tabs-container {
    position: sticky;
    top: -10px;
    z-index: 100;
    background: var(--sheet-bg);
    margin: -10px -16px 16px -16px;
    padding: 10px 16px 8px 16px;
}

.sub-tabs {
    display: flex;
    background: var(--option-bg);
    padding: 4px;
    border-radius: 12px;
    gap: 4px;
}

.sub-tab-item {
    flex: 1;
    padding: 8px 0;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--secondary-text);
    cursor: pointer;
    border-radius: 9px;
    transition: all 0.2s;
}

.sub-tab-item.active {
    background: var(--option-bg-hover);
    color: var(--text-color);
    box-shadow: var(--box-shadow);
}

/* 深色主题下的子标签 */
.dark-theme .sub-tab-item.active {
    background: var(--option-bg-hover);
    box-shadow: var(--box-shadow);
}

.sub-tab-content {
    display: none;
}

.sub-tab-content.active {
    display: block;
}

.countdown-toggle-wrapper .slider:before {
    height: 20px;
    width: 20px;
}

.countdown-toggle-wrapper input:checked+.slider:before {
    transform: translateX(16px);
}

/* Toast */
#toast {
    position: fixed;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    color: black;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 1000;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#toast.show {
    opacity: 1;
}

/* Step Indicator */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px 20px 20px;
    gap: 10px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.step-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--option-border);
    color: var(--secondary-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s;
}

.step.active .step-circle {
    background: var(--accent-color);
    color: var(--text-color);
}

.step.completed .step-circle {
    background: #4cd964;
    color: var(--text-color);
}

.step-label {
    font-size: 11px;
    color: var(--secondary-text);
    transition: color 0.3s;
}

.step.active .step-label {
    color: var(--accent-color);
}

.step-line {
    flex: 1;
    height: 2px;
    background: var(--option-border);
    max-width: 40px;
}

.step-line.active {
    background: var(--accent-color);
}

/* Step Content */
.step-content {
    display: none;
    animation: fadeIn 0.3s;
}

.step-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Config Summary */
.config-summary {
    background: var(--option-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--option-border);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    color: var(--secondary-text);
    font-size: 14px;
}

.summary-value {
    color: var(--text-color);
    font-size: 14px;
    font-weight: 500;
}

/* Processing */
.processing-container {
    text-align: center;
    padding: 40px 20px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--option-border);
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.processing-text {
    color: var(--secondary-text);
    font-size: 14px;
    margin: 10px 0;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--option-border);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 20px;
}

.progress-fill {
    height: 100%;
    background: var(--accent-color);
    width: 0%;
    animation: progress 2s ease-in-out;
}

@keyframes progress {
    0% {
        width: 0%;
    }

    100% {
        width: 100%;
    }
}

/* Success */
.success-container {
    text-align: center;
    padding: 20px;
}

.success-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.link-display {
    background: #2c2c2e;
    border-radius: 12px;
    padding: 15px;
    margin: 20px 0;
}

#generated-url {
    background: #1c1c1e;
    border: 1px solid #444;
    color: var(--accent-color);
    padding: 12px;
    border-radius: 8px;
    width: 100%;
    font-size: 12px;
    word-break: break-all;
}

.usage-steps {
    text-align: left;
    margin-top: 25px;
}

.usage-steps h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--text-color);
}

.step-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 14px;
}

.step-number {
    width: 24px;
    height: 24px;
    background: var(--accent-color);
    color: var(--text-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

/* Guide Styles */
.guide-container {
    background: #2c2c2e;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #333;
    text-align: left;
}

.guide-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-color);
}

.guide-step {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}

.guide-step:last-child {
    margin-bottom: 0;
}

.guide-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color);
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
    margin-top: 2px;
}

.guide-text {
    font-size: 14px;
    color: var(--secondary-text);
    line-height: 1.5;
}

.guide-text b {
    color: var(--text-color);
}

/* Link Tab Styles */
.result {
    display: block;
    text-align: center;
    animation: slideUp 0.5s ease;
    width: 100%;
}

.default-success {
    color: #ff693c;
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 20px;
    display: none;
}

.mock-msg {
    color: #ff453a;
    font-size: 0.85rem;
    margin-bottom: 20px;
    line-height: 1.4;
    display: none;
    border: 1px solid #ff453a;
    padding: 12px;
    border-radius: 12px;
    background: rgba(255, 69, 58, 0.1);
    text-align: left;
}

.custom-url-display {
    display: block;
}

.url-container {
    gap: 10px;
    margin: 10px 0;
}

.url-box {
    background: var(--input-bg);
    padding: 12px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 13px;
    color: var(--accent-color);
    border: 1px solid var(--input-border);
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.copy-btn {
    margin-top: 10px;
    background: var(--btn-bg);
    border: 1px solid var(--accent-color);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-color);
    width: 100%;
    white-space: nowrap;
    padding: 10px;
    font-size: 0.9rem;
    font-weight: bold;
    transition: background 0.2s;
}

.copy-btn:hover {
    background: var(--accent-color);
}

.shortcut-section {
    background: var(--option-bg);
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 12px;
    border: 1px solid var(--option-border);
}

.shortcut-btn {
    background: #0169d9;
    color: #ffffff;
    display: block;
    width: 100%;
    margin-bottom: 10px;
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
    text-decoration: none;
    margin-top: 10px;
    box-sizing: border-box;
}

.shortcut-section span {
    color: var(--text-color);
    padding: 0 5px;
    font-weight: 700;
}

.shortcut-section .link-shortcuts-app {
    padding: 0 5px;
    text-underline-offset: 2px;
    text-decoration-line: underline;
}

/* 浅色主题下的样式 */
.dark-theme .processing-text {
    color: var(--secondary-text);
}

.dark-theme .loading-spinner {
    border: 3px solid var(--border-color);
}

.dark-theme .progress-bar {
    background: var(--border-color);
}

.dark-theme .link-display {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
}

.dark-theme #generated-url {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
}

.dark-theme .usage-steps h3 {
    color: var(--text-color);
}

.dark-theme .guide-container {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
}

.dark-theme .guide-title {
    color: var(--text-color);
}

.dark-theme .guide-text {
    color: var(--secondary-text);
}

.dark-theme .guide-text b {
    color: var(--text-color);
}

.dark-theme .mock-msg {
    border: 1px solid #ff453a;
    background: rgba(255, 69, 58, 0.1);
}

.dark-theme .url-box {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
}

.dark-theme .copy-btn {
    background: var(--btn-bg);
    border: 1px solid var(--accent-color);
    color: var(--text-color);
}

.dark-theme .copy-btn:hover {
    color: var(--text-color);
}

.dark-theme .shortcut-section {
    background: var(--option-bg);
    border: 1px solid var(--option-border);
}

.dark-theme .shortcut-section span {
    color: var(--text-color);
}

.dark-theme .shortcut-section .link-shortcuts-app {
    color: var(--accent-color);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header Actions */
.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Calendar Mode Grid 3 Columns */
.calendar-mode-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* Mode Icon Large */
.mode-icon-large {
    font-size: 18px;
}

/* Countdown Label */
.countdown-label {
    font-size: 10px;
    color: #ff693c;
    float: right;
    margin: 3px 28px 0 0;
}

/* Toggle Container Vertical */
.toggle-container-vertical {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
}

/* Toggle Header */
.toggle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Bar Style Container */
.bar-style-container {
    display: none;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--option-border);
}

/* Bar Style Grid */
.bar-style-grid {
    grid-template-columns: repeat(3, 1fr);
    margin-bottom: 0;
}

/* Bar Style Segmented */
.bar-style-segmented {
    display: flex;
    gap: 2px;
    align-items: center;
}

.bar-style-segmented-dot {
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 1px;
}

/* Bar Style Solid */
.bar-style-solid {
    display: flex;
    align-items: center;
}

.bar-style-solid-bar {
    width: 20px;
    height: 6px;
    background: currentColor;
    border-radius: 2px;
}

/* Bar Style None */
.bar-style-none {
    display: flex;
    align-items: center;
}

.bar-style-none-line {
    width: 20px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
}

/* Date List Container */
.date-list-container {
    margin-bottom: 20px;
}

/* 深色主题下的进度条样式容器 */
.dark-theme .bar-style-container {
    border-top: 1px solid var(--border-color);
}

/* Weekend Toggle Container */
.weekend-toggle-container {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-bottom: 20px;
}

/* Weekend Color Container */
.weekend-color-container {
    display: none;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--option-border);
}

/* Weekend Color Label */
.weekend-color-label {
    margin: 0 0 10px 0;
    font-size: 11px;
    font-weight: 600;
    color: var(--secondary-text);
}

/* 深色主题下的周末颜色容器 */
.dark-theme .weekend-color-container {
    border-top: 1px solid var(--border-color);
}

/* Hidden File Input */
.hidden-file-input {
    display: none;
}

/* Background Controls */
.bg-controls {
    display: none;
    margin-top: 20px;
}

/* Gesture Hint */
.gesture-hint {
    background: rgba(10, 132, 255, 0.1);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(10, 132, 255, 0.2);
}

/* Hint Emoji */
.hint-emoji {
    font-size: 16px;
}

/* Hint Text */
.hint-text {
    font-size: 12px;
    color: #0a84ff;
    line-height: 1.4;
    font-weight: 500;
}

/* Slider Container */
.slider-container {
    margin-bottom: 15px;
}

/* Slider Header */
.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

/* Slider Label */
.slider-label {
    font-size: 11px;
    font-weight: 600;
    color: #888;
}

/* Slider Value */
.slider-value {
    font-size: 11px;
    color: #0a84ff;
    font-weight: 600;
}

/* Slider Container Large */
.slider-container-large {
    margin-bottom: 20px;
}

/* 深色主题下的提示框 */
.dark-theme .gesture-hint {
    background: rgba(10, 132, 255, 0.1);
    border: 1px solid rgba(10, 132, 255, 0.25);
}

/* Mask Mode Selector */
.mask-mode-selector {
    display: flex;
    background: var(--option-bg);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 12px;
    gap: 4px;
}

.mask-mode-btn {
    flex: 1;
    border: none;
    background: transparent;
    border-radius: 9px;
    padding: 8px 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--secondary-text);
    transition: all 0.2s;
}

.mask-mode-btn.active {
    background: var(--option-bg-hover);
    color: var(--text-color);
    box-shadow: var(--box-shadow);
}

/* 深色主题下的遮罩选择器 */
.dark-theme .mask-mode-btn.active {
    background: var(--option-bg-hover);
    box-shadow: var(--box-shadow);
}

/* Button Danger */
.btn-danger {
    color: #ff453a;
    margin-top: 15px;
}

/* Custom Color Note */
.custom-color-note {
    font-size: 11px;
    color: var(--secondary-text);
    margin-top: 15px;
    padding: 0 5px;
}

/* 深色主题下的自定义配色说明 */
.dark-theme .custom-color-note {
    color: var(--secondary-text);
}

/* Slider Label Block */
.slider-label-block {
    display: block;
    margin-bottom: 10px;
}

/* Slider Label Medium */
.slider-label-medium {
    font-weight: 500;
}

/* Slider Value Tabular */
.slider-value-tabular {
    font-variant-numeric: tabular-nums;
}

/* Hidden Section */
.hidden-section {
    display: none;
}

/* Step Label */
.step-label {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    color: var(--text-color);
}

.step-label-secondary {
    color: var(--secondary-text);
}

/* Guide Container Transparent */
.guide-container-transparent {
    text-align: center;
    background: inherit;
    border: none;
    padding: 0;
}

/* Generated BG Container */
.generated-bg-container {
    margin: 15px 0;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-color);
    aspect-ratio: 9/19.5;
    width: 160px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

/* BG Loading Overlay */
.bg-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2;
}

/* Loading Spinner Small */
.loading-spinner-small {
    width: 24px;
    height: 24px;
    margin: 0;
}

/* Generated BG Image */
.generated-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    z-index: 1;
}

/* Guide Step Center */
.guide-step-center {
    justify-content: center;
    margin-bottom: 20px;
}

/* Guide Text Center */
.guide-text-center {
    text-align: center;
}

/* Small Text */
.small-text {
    font-size: 11px;
    color: var(--secondary-text);
}

/* Border Top Section */
.border-top-section {
    border-top: 1px solid var(--option-border);
    padding-top: 15px;
    text-align: left;
}

/* Step Label Small */
.step-label-small {
    margin: 0 0 10px 0;
    font-size: 0.8rem;
    color: var(--secondary-text);
    line-height: 1.4;
    text-align: left;
}

/* Step Label Small Secondary */
.step-label-small-secondary {
    margin: 0 0 20px 0;
}

/* Step Text */
.step-text {
    margin: 0 0 10px 0;
    font-size: 0.8rem;
    color: var(--secondary-text);
    line-height: 1.4;
    text-align: left;
}

/* Automation Image */
.automation-img {
    width: 100%;
}

footer {
    margin-top: auto;
    color: #555;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    padding: 20px 0 100px 0;
    width: 100%;
    text-align: center
}

.footer-link {
    color: #ff693c;
    text-decoration: none;
    border-bottom: 1px dotted #ccc;
    transition: color .2s;
    cursor: pointer;
    font-size: 15px;
    margin: 5px 15px 0 0;
    display: inline-block
}

.footer-link:hover {
    color: #ff693c;
    border-color: #ff693c
}

/* Inline Button Secondary */
.btn-secondary-inline {
    margin-top: 0;
    background: var(--btn-bg);
    width: auto;
    padding: 5px 10px;
    border-radius: 20px;
}

/* 深色主题下的步骤标签 */
.dark-theme .step-label {
    color: var(--text-color);
}

.dark-theme .step-label-secondary {
    color: var(--secondary-text);
}

.dark-theme .small-text {
    color: var(--secondary-text);
}

.dark-theme .border-top-section {
    border-top: 1px solid var(--border-color);
}

.dark-theme .step-label-small {
    color: var(--secondary-text);
}

.dark-theme .step-text {
    color: var(--secondary-text);
}