@import url(https://fonts.googleapis.com/css?family=Righteous);

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3498db; 
    --accent-color: #2ecc71; 
    --text-color: #333;
    --light-bg: #f5f7fa;
    --card-bg: #fff;
    --border-color: #e1e8ed;
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --spacing: 1.5rem;
    --gradient-start: #e0f2f7;
    --gradient-middle: #c5e1ee;
    --gradient-end: #a9d4e5;
}

body {
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background:
        radial-gradient(at 50% 0, transparent, #080808),
        repeating-conic-gradient(
            hsla(0, 0%, 0%, .235) 0% 25%,
            transparent 0% 50%
        ) 0 0 / 0.375em 0.375em,
        #3b3b3b;
    min-height: 100vh;
    padding: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden; /* 防止大标题导致横向滚动 */
}

/* 移除网格线背景 wrapper，不再需要 */
#background-wrapper {
    display: none;
}

.container {
    max-width: 90rem;
    margin: 0 auto;
    padding: 20px 1rem;
    position: relative;
    z-index: 2;
    width: 100%;
    flex: 1;
}

/* Landing page layout */
body.landing-page .page-container {
    max-width: 90rem;
    margin: 0 auto;
    width: 100%;
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px 1rem;
}

/* Navbar (aligned with CCFDDL) */
.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    align-self: stretch;
    background-color: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px) saturate(1.2);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
}

.nav-content {
    max-width: 80rem;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.logo-icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    object-fit: cover;
}

.logo-text-desktop {
    font-weight: 900;
    color: hsl(0 0% 95%);
    letter-spacing: 0.05em;
    font-size: 1.125rem;
    font-family: 'Righteous', 'Microsoft YaHei', sans-serif;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    justify-content: flex-end;
}

.nav-btn {
    -webkit-tap-highlight-color: #0000;
    cursor: pointer;
    border-radius: 12px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    background: #0000;
    border: 1px solid #0000;
    position: relative;
    color: white;
    transition: translate 0.1s ease-out, scale 0.1s ease-out;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    text-decoration: none;
}

.nav-btn::before,
.nav-btn::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    pointer-events: none;
}

.nav-btn::before {
    z-index: -1;
    background: linear-gradient(
        hsl(0 0% 100% / 0.18),
        hsl(0 0% 4% / 0.7)
    );
    backdrop-filter: saturate(2) contrast(1) blur(10px);
}

.nav-btn::after {
    box-shadow: 0 0 1px 0.8px hsl(0 0% 100% / 0.8) inset;
    mask: linear-gradient(-35deg, #ffffff80, #ffffff30 30% 60%, #fff);
}

.nav-btn:active:not(:disabled) {
    scale: 0.98;
    translate: 0 1px;
}

.nav-btn:hover:not(:disabled) {
    scale: 1.02;
}

body.landing-page .header {
    text-align: center;
    margin-bottom: 2rem;
}

body.landing-page .landing-container {
    text-align: center;
    padding: 2rem;
    position: relative;
    z-index: 2;
}

.button-container {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
    justify-content: center;
}

.description {
    margin-top: 1rem;
    color: hsl(0 0% 70%);
    font-size: 0.9rem;
    position: relative;
    z-index: 2;
}

/* --- 标题样式 --- */
h1 {
    display: inline-block;
    color: hsl(0 0% 90%);
    font-family: 'Righteous', 'Microsoft YaHei', serif;
    font-size: 5em; /* 采用 style.css 的超大字号 */
    text-shadow: .03em .03em 0 hsla(230,40%,50%,1); /* 采用 style.css 的阴影色 */
    position: relative;
    line-height: 1.2;
    margin-bottom: 2rem;
    margin-top: 0.5rem;
    width: 100%;
    text-align: center;
}

h1::after {
    content: attr(data-shadow);
    position: absolute;
    top: .06em;
    left: .06em;
    width: 100%;
    height: 100%;
    z-index: -1;
    text-shadow: none;
    background-image: linear-gradient(
        45deg,
        transparent 45%,
        hsla(48,20%,90%,1) 45%, /* 采用 style.css 的米白色条纹 */
        hsla(48,20%,90%,1) 55%,
        transparent 0
    );
    background-size: .08em .08em;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    white-space: nowrap;
    animation: shad-anim 60s linear infinite;
}

h2, h3 {
    color: hsl(0 0% 90%);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 1.5rem;
}

h3 {
    font-size: 1.2rem;
}

@keyframes shad-anim {
    0% { background-position: 0 0; }
    100% { background-position: 100% -100%; }
}

/* --- 表单与区块样式 --- */
form {
    padding: 2rem;
    border-radius: var(--border-radius);
}

.main-content {
    display: flex;
    gap: var(--spacing);
    margin-bottom: var(--spacing);
}

.left-column, .right-column {
    flex: 1;
    min-width: 0;
}

.section {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px) saturate(1.2);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: var(--spacing);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.section:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.15);
}

.section-title {
    font-size: 1.3rem;
    color: hsl(0 0% 95%);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

.form-group {
    margin-bottom: 1.2rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: hsl(0 0% 85%);
    font-weight: 500;
    font-size: 0.95rem;
}

input[type="text"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    color: hsl(0 0% 95%);
    backdrop-filter: blur(10px);
}

input[type="text"]::placeholder,
textarea::placeholder {
    color: hsl(0 0% 60%);
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    border-color: rgba(255, 255, 255, 0.3);
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.08);
}

input.error,
textarea.error,
select.error {
    border-color: hsl(10 80% 70%);
    box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.12);
}

.font-preview {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: hsl(0 0% 85%);
}

select option {
    background: #2a2a2a;
    color: white;
}

.margins-grid, .font-settings {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.header-footer-settings {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-title {
    font-size: 1.1rem;
    color: hsl(0 0% 90%);
    margin-bottom: 1rem;
    font-weight: 600;
}

.checkbox-group {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: hsl(0 0% 80%);
}

.checkbox-item label {
    margin: 0;
    cursor: pointer;
    color: hsl(0 0% 85%);
}

#firstPageContent {
    width: 100%;
    min-height: 200px;
    white-space: pre-wrap;
}

.form-actions {
    text-align: center;
    margin-top: 2rem;
}

.back-btn {
    display: inline-block;
    margin-bottom: 1.5rem;
    color: hsl(0 0% 85%);
    text-decoration: none;
    transition: color 0.3s ease;
    font-size: 1rem;
}

.back-btn:hover {
    color: hsl(0 0% 100%);
}

.page-number-settings {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#headerTextGroup,
#footerTextGroup,
#pageNumberAlignmentGroup {
    display: none;
}

.required::after {
    content: "*";
    color: hsl(10 80% 70%);
    margin-left: 4px;
}

button, .btn {
    -webkit-tap-highlight-color: #0000;
    cursor: pointer;
    border-radius: 12px;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    background: #0000;
    border: 1px solid #0000;
    position: relative;
    color: white;
    transition-property: translate, scale;
    transition-duration: 0.1s;
    transition-timing-function: ease-out;
    text-decoration: none;
    display: inline-block;
}

button:active, .btn:active {
    scale: 0.98;
    translate: 0 1px;
}

button::before,
button::after,
.btn::before,
.btn::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    pointer-events: none;
}

button::before,
.btn::before {
    z-index: -1;
    background: linear-gradient(
        hsl(0 0% 100% / 0.18),
        hsl(0 0% 4% / 0.7)
    );
    backdrop-filter: saturate(2) contrast(1) blur(10px);
}

button::after,
.btn::after {
    box-shadow: 0 0 1px 0.8px hsl(0 0% 100% / 0.8) inset;
    mask: linear-gradient(-35deg, #ffffff80, #ffffff30 30% 60%, #fff);
}

button:hover,
.btn:hover {
    scale: 1.02;
}

.btn + .btn {
    margin-left: 10px;
}

/* --- 响应式设计 (针对大标题进行了优化) --- */
@media (max-width: 1200px) {
    h1 { font-size: 5em; }
}

@media (max-width: 1024px) {
    .main-content { flex-direction: column; }
    h1 { font-size: 4em; }
    .margins-grid, .font-settings { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    h1 { font-size: 3em; }
    .container { padding: 1rem; }
    body.landing-page .page-container { padding: 10px 1rem; }
    form, .section { padding: 1rem; }
    .checkbox-group { flex-direction: column; gap: 1rem; }
}

@media (max-width: 480px) {
    h1 { font-size: 2.2em; }
    button { width: 100%; }
}

/* 其他功能性样式 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* fillinCode 页面特定样式 */
.fillinCode-file-input-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.fillinCode-file-input-wrapper input[type="file"] {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.fillinCode-file-input-trigger {
    display: block;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    text-align: center;
    color: hsl(0 0% 85%);
    transition: all 0.3s;
    cursor: pointer;
}

.fillinCode-file-input-wrapper:hover .fillinCode-file-input-trigger {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

.fillinCode-file-name {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: hsl(0 0% 75%);
}

.back-to-tree-link {
    display: block;
    margin-bottom: 15px;
    color: hsl(0 0% 85%);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.back-to-tree-link:hover {
    color: hsl(0 0% 100%);
}

#displayFileName {
    margin-bottom: 10px;
    color: hsl(0 0% 90%);
}

#displayFileCode {
    display: block;
    margin: 0;
    padding: 15px;
    white-space: pre;
    overflow-x: auto;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: hsl(0 0% 90%);
    box-sizing: border-box;
}

#fileContentDisplay,
#processingStatus {
    display: none;
}

.directory-item, .file-item {
    padding: 5px 10px;
    margin: 2px 0;
    cursor: pointer;
    transition: background-color 0.2s;
    border-radius: 6px;
}

.directory-item:hover, .file-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.directory-item {
    color: hsl(0 0% 90%);
    font-weight: 600;
}

.file-item {
    color: hsl(0 0% 80%);
}

.folder-icon, .file-icon {
    margin-right: 5px;
}

.required-field::after {
    content: '*';
    color: hsl(10 80% 70%);
    margin-left: 4px;
}

#docStatusDisplay {
    padding: 10px;
    border-radius: 10px;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
}

#processingStatus {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#progressInfo {
    margin-top: 1rem;
    color: hsl(0 0% 85%);
    line-height: 1.8;
}

#fileContentDisplay {
    margin-top: 2rem;
}

#fileTree {
    margin-top: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 400px;
    overflow-y: auto;
}

.tree-item {
    margin-left: 1.5rem;
    position: relative;
    color: hsl(0 0% 85%);
}

.tree-item::before {
    content: "├─";
    position: absolute;
    left: -1.5rem;
    color: hsl(0 0% 70%);
}

.tree-item:last-child::before {
    content: "└─";
}

/* ===== 日间模式样式 ===== */
/* 页面初始加载时的日间模式支持 - 只为关键元素添加以避免CSS冗余 */
html.day-init body,
body.day-mode {
    background: #f0f4f8;
    background-image: url(../../../../assets/image/day-background.png);
    background-size: auto;
    background-repeat: repeat;
    font-family: 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html.day-init #background-wrapper,
body.day-mode #background-wrapper {
    background-color: transparent;
}

html.day-init .section,
html.day-init .header-footer-settings,
html.day-init .page-number-settings,
html.day-init #processingStatus,
html.day-init #fileTree,
body.day-mode .section,
body.day-mode .header-footer-settings,
body.day-mode .page-number-settings,
body.day-mode #processingStatus,
body.day-mode #fileTree {
    background: hsla(0, 0%, 100%, 0.4);
    border: none;
    box-shadow: 5px 3px 30px rgba(0, 0, 0, 0.1);
}

html.day-init h1,
body.day-mode h1 {
    color: #2d3748;
    text-shadow: .03em .03em 0 hsla(200, 60%, 60%, 1);
}

/* 以下样式只使用 body.day-mode，由 JS 在加载后应用 */
html.day-init .back-btn,
html.day-init .back-to-tree-link,
body.day-mode .back-btn,
body.day-mode .back-to-tree-link {
    color: #4a5568;
}

html.day-init .back-btn:hover,
html.day-init .back-to-tree-link:hover,
body.day-mode .back-btn:hover,
body.day-mode .back-to-tree-link:hover {
    color: #1a202c;
}


body.day-mode h2,
body.day-mode h3 {
    color: #1a202c;
    font-weight: 600;
}

body.day-mode .section:hover {
    box-shadow: 5px 5px 35px rgba(0, 0, 0, 0.15);
}

body.day-mode .section-title,
body.day-mode .settings-title {
    color: #1a202c;
    border-color: rgba(0, 0, 0, 0.2);
}

body.day-mode label,
body.day-mode .checkbox-item label {
    color: #2d3748;
    font-weight: 500;
}

body.day-mode input[type="text"],
body.day-mode input[type="number"],
body.day-mode select,
body.day-mode textarea {
    background: rgba(255, 255, 255, 0.7);
    color: #1a202c;
    border-color: rgba(0, 0, 0, 0.15);
}

body.day-mode input[type="text"]:focus,
body.day-mode input[type="number"]:focus,
body.day-mode select:focus,
body.day-mode textarea:focus {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.25);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

body.day-mode input[type="text"]::placeholder,
body.day-mode textarea::placeholder {
    color: #a0aec0;
}

body.day-mode .font-preview {
    background: rgba(255, 255, 255, 0.7);
    color: #2d3748;
    border-color: rgba(0, 0, 0, 0.12);
}

body.day-mode select option {
    background: #ffffff;
    color: #1a202c;
}

/* 基础按钮样式 */
body.day-mode button,
body.day-mode .btn {
    background: #ffffff;
    color: #1a202c;
    border: 2px solid #cbd5e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

body.day-mode button::before,
body.day-mode .btn::before {
    background: none;
    backdrop-filter: none;
}

body.day-mode button:hover,
body.day-mode .btn:hover {
    background: #f7fafc;
    border-color: #a0aec0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body.day-mode .fillinCode-file-input-trigger {
    background: rgba(255, 255, 255, 0.7);
    color: #2d3748;
    border-color: rgba(0, 0, 0, 0.15);
}

body.day-mode .fillinCode-file-input-wrapper:hover .fillinCode-file-input-trigger {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.25);
}

body.day-mode .fillinCode-file-name,
body.day-mode #progressInfo {
    color: #4a5568;
}

body.day-mode #displayFileName {
    color: #1a202c;
}

body.day-mode #displayFileCode {
    background: rgba(255, 255, 255, 0.7);
    color: #1a202c;
    border-color: rgba(0, 0, 0, 0.15);
}

body.day-mode .directory-item,
body.day-mode .file-item {
    color: #2d3748;
}

body.day-mode .directory-item:hover,
body.day-mode .file-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

body.day-mode .tree-item {
    color: #2d3748;
}

body.day-mode .tree-item::before {
    color: #718096;
}

body.day-mode .description {
    color: #4a5568;
}

body.day-mode .navbar {
    background-color: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

body.day-mode .logo-text-desktop {
    color: #1a202c;
    font-weight: bold;
    text-shadow: none;
}

body.day-mode .nav-btn {
    background: #ffffff;
    color: #1a202c;
    border: 2px solid #cbd5e0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

body.day-mode .nav-btn::before {
    background: none;
    backdrop-filter: none;
}

body.day-mode .nav-btn::after {
    display: none;
}

body.day-mode .nav-btn:hover:not(:disabled) {
    background: #f7fafc;
    border-color: #a0aec0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.navbar .theme-toggle-container {
    width: 60px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.navbar .theme-toggle {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    z-index: 1000;
    user-select: none;
    transform: scale(0.45);
    transform-origin: center;
}

@media (max-width: 639px) {
    .nav-content {
        flex-direction: column;
        gap: 0.75rem;
        align-items: center;
        padding: 0.75rem 1rem;
    }

    .logo-wrapper {
        justify-content: center;
        width: 100%;
    }

    .nav-actions {
        justify-content: center;
        width: 100%;
        gap: 0.75rem;
        flex-wrap: wrap;
    }
}

@media (min-width: 640px) {
    .nav-content {
        flex-direction: row;
        padding: 0.75rem 1.5rem;
    }
}

/* ===== 日夜切换器样式 ===== */
.theme-toggle {
  --theme-toggle-scale: 0.52;
  position: fixed;
  top: clamp(12px, 2vw, 20px);
  right: clamp(12px, 2vw, 20px);
  z-index: 1000;
  user-select: none;
  transform: scale(var(--theme-toggle-scale));
  transform-origin: top right;
}

.theme-toggle__checkbox {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.theme-toggle__btn {
  display: block;
  position: relative;
  width: 125px;
  height: 70px;
  border-radius: 70px;
  border: 5px solid #1c1c1c;
  background-color: #3c4145;
  cursor: pointer;
  transition: all 350ms ease-in;
}

.theme-toggle__checkbox:focus-visible + .theme-toggle__btn {
  outline: 3px solid rgba(255, 255, 255, 0.8);
  outline-offset: 4px;
}

body.day-mode .theme-toggle__checkbox:focus-visible + .theme-toggle__btn {
  outline-color: rgba(0, 0, 0, 0.55);
}

/* 禁用初始加载时的动画 */
.theme-toggle__btn.no-transition,
.theme-toggle__btn.no-transition::before,
.theme-toggle__btn.no-transition::after,
.theme-toggle__btn.no-transition .theme-toggle__feature,
.theme-toggle__btn.no-transition .theme-toggle__feature::before {
  transition: none !important;
  animation: none !important;
}

.theme-toggle__btn::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background-color: #fff;
  border: 5px solid #e3e3c7;
  transition: all 250ms ease-in;
}

.theme-toggle__btn::after {
  content: '';
  position: absolute;
  top: 62%;
  left: 39px;
  z-index: 10;
  width: 9.2px;
  height: 9.2px;
  opacity: 0;
  background-color: #fff;
  border-radius: 50%;
  box-shadow:
    #fff 0 0,
    #fff 2.5px 0,
    #fff 5px 0,
    #fff 7.5px 0,
    #fff 9px 0,
    #fff 11.5px 0,
    #fff 13px 0,
    #fff 17px -1px 0 1px,
    #fff 13px -6px 0 -2px,
    #fff 6px -6px 0 1px,
    #d3d3d3 0 0 0 3.5px,
    #d3d3d3 5px 0 0 3.5px,
    #d3d3d3 9px 0 0 3.5px,
    #d3d3d3 13px 0 0 3.5px,
    #d3d3d3 17px -1px 0 4.5px,
    #d3d3d3 13px -6px 0 1px,
    #d3d3d3 6px -6px 0 4.5px;
  transition: opacity 100ms ease-in;
}

.theme-toggle__feature {
  display: block;
  position: absolute;
  top: 9px;
  left: 52.5%;
  z-index: 20;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: #fff;
  box-shadow:
    rgba(255,255,255,0.1) 30px -3px 0 0,
    rgba(255,255,255,0.1) 12px 10px 0 -1px,
    #fff 38px 18px 0 1px,
    rgba(255,255,255,0.1) 32px 34px 0 0,
    #fff 20px 24px 0 -1.5px,
    rgba(255,255,255,0.1) 5px 38px 0 1px;
  animation: starry_star 5s ease-in-out infinite;
}

.theme-toggle__feature::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -25px;
  width: 15px;
  height: 15px;
  background-color: #fff;
  border-radius: 50%;
  border: 4px solid #e3e3c7;
  box-shadow:
    #e3e3c7 -28px 0 0 -3px,
    #e3e3c7 -8px 24px 0 -2px;
  transform-origin: -6px 130%;
  transition: all 250ms ease-in;
}

@keyframes starry_star {
  50% {
    background-color: rgba(255,255,255,0.1);
    box-shadow:
      #fff 30px -3px 0 0,
      #fff 12px 10px 0 -1px,
      rgba(255,255,255,0.1) 38px 18px 0 1px,
      #fff 32px 34px 0 0,
      rgba(255,255,255,0.1) 20px 24px 0 -1.5px,
      #fff 5px 38px 0 1px;
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(.3);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
  55% {
    transform: scale(1.1);
  }
  75% {
    transform: scale(.9);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.theme-toggle__checkbox:checked + .theme-toggle__btn {
  background-color: #9ee3fb;
  border: 5px solid #86c3d7;
}

.theme-toggle__checkbox:checked + .theme-toggle__btn::before {
  left: 57px;
  background-color: #ffdf6d;
  border: 5px solid #e1c348;
}

.theme-toggle__checkbox:checked + .theme-toggle__btn::after {
  opacity: 1;
  animation-name: bounceIn;
  animation-duration: 0.60s;
  animation-delay: 0.10s;
  animation-fill-mode: backwards;
  animation-timing-function: ease-in-out;
}

.theme-toggle__checkbox:checked + .theme-toggle__btn .theme-toggle__feature {
  opacity: 0;
  box-shadow:
    rgba(255,255,255,0.1) 30px -3px 0 -4px,
    rgba(255,255,255,0.1) 12px 10px 0 -5px,
    #fff 38px 18px 0 -3px,
    rgba(255,255,255,0.1) 32px 34px 0 -4px,
    #fff 20px 24px 0 -5.5px,
    rgba(255,255,255,0.1) 5px 38px 0 -3px;
  animation: none;
}

.theme-toggle__checkbox:checked + .theme-toggle__btn .theme-toggle__feature::before {
  left: 25px;
  transform: rotate(70deg);
}

@media (min-width: 769px) and (max-width: 1024px) {
  .theme-toggle {
    --theme-toggle-scale: 0.47;
  }

}

@media (max-width: 768px) {
  .theme-toggle {
    --theme-toggle-scale: 0.42;
    position: absolute;
    top: calc(env(safe-area-inset-top, 0px) + 10px);
    right: 10px;
    z-index: 2;
  }

}

/* ===== 页脚样式 ===== */
.footer {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 2rem 1rem;
  text-align: center;
  margin-top: 3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer p {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.4);
  transition: color 300ms ease-out;
  line-height: 1.8;
}

/* 日间模式页脚样式 */
body.day-mode .footer p {
  color: rgba(0, 0, 0, 0.5);
}

body.day-mode .footer {
  border-top-color: rgba(0,0,0,0.1);
}

/* 页脚响应式 */
@media (max-width: 768px) {
  .footer {
    padding: 1.5rem 1rem;
  }

  .footer p {
    font-size: 0.75rem;
  }
}
