/* :root 和所有主题样式均来自【基石版 2.0】 */
:root {
    --bg-color: #f4f4f9;
    --container-bg-color: #ffffff;
    --editor-bg-color: #ffffff;
    --text-color: #333333;
    --locked-text-color: var(--editor-bg-color);
    --border-color: #ccc;
    --focus-border-color: #007bff;
    --secondary-text-color: #888;
    --button-bg: #f0f0f0;
    --button-text: #555;
    --button-active-bg: #007bff;
    --button-active-text: #fff;
}
body.eye-care-theme {
    --bg-color: #ABCBAB;
    --container-bg-color: #ABCBAB;
    --editor-bg-color: #ABCBAB;
    --text-color: #0a2e10;
    --locked-text-color: var(--editor-bg-color);
    --border-color: #8dbb93;
    --secondary-text-color: #2b5d34;
    --button-bg: #cce8cf;
    --button-text: #0a2e10;
    --button-active-bg: #2b5d34;
    --button-active-text: #fff;
}
body.fresh-theme {
    --bg-color: #e6f7ff;
    --container-bg-color: #e6f7ff;
    --editor-bg-color: #e6f7ff;
    --text-color: #0d47a1;
    --locked-text-color: var(--editor-bg-color);
    --border-color: #b3e5fc;
    --secondary-text-color: #549dc7;
    --button-bg: #ccebff;
    --button-text: #0d47a1;
    --button-active-bg: #0d47a1;
}
body.dark-theme {
    --bg-color: #121212;
    --container-bg-color: #1e1e1e;
    --editor-bg-color: #1e1e1e;
    --text-color: #e0e0e0;
    --locked-text-color: var(--editor-bg-color);
    --border-color: #444;
    --focus-border-color: #5899d4;
    --secondary-text-color: #999;
    --button-bg: #333;
    --button-text: #ddd;
    --button-active-bg: #5899d4;
    --button-active-text: #fff;
}
/* 页面布局 - 核心改动 */
body {
    display: flex; /* 启用Flexbox布局 */
    flex-direction: column; /* 垂直排列子元素 */
    min-height: 100vh; /* 最小高度为整个视窗 */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    transition: background-color 0.3s, color 0.3s;
}
.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto; /* 水平居中 */
    background-color: var(--container-bg-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 30px;
    transition: background-color 0.3s;
}
h1 { 
    text-align: center;
    margin-bottom: 25px;
    color: var(--text-color);
}
.controls-panel {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}
#focus-timer {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 200px;
}
#focus-icon {
    width: 60px;
    height: 60px;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
    border-radius: 50%;
    object-fit: cover;
}
#focus-icon:hover {
    transform: scale(1.05);
}
#timer-active-state {
    display: flex;
    flex-direction: column;
    align-items: center;
}
#timer-display {
    font-size: 2.2em;
    font-weight: bold;
    color: var(--text-color);
    margin-bottom: 8px;
}
#timer-controls {
    display: flex;
    gap: 10px;
}
#file-actions button, 
#theme-switcher button, 
#lang-switcher button,
.outline-controls button,
#timer-controls button {
    background-color: var(--button-bg);
    color: var(--button-text);
    border: 1px solid var(--border-color);
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.2s, color 0.2s;
    white-space: nowrap;
    min-width: 80px;
    text-align: center;
}
#file-actions button:hover, 
#theme-switcher button:hover, 
#lang-switcher button:hover,
.outline-controls button:hover,
#timer-controls button:hover {
    opacity: 0.9;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}
#theme-switcher {
    display: grid;
    grid-template-columns: repeat(2, auto);
    gap: 8px;
    justify-items: start;
}
#lang-switcher {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-end;
}
.instructions { 
    color: var(--secondary-text-color); 
    text-align: left;
    margin-bottom: 20px;
}
#theme-switcher button.active, #lang-switcher button.active {
    background-color: var(--button-active-bg);
    color: var(--button-active-text);
    border-color: var(--button-active-bg);
}
.bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}
#file-actions {
    display: flex;
    gap: 10px;
}
.outline-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}
#outline-editor {
    width: 100%;
    height: 135px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--editor-bg-color);
    color: var(--text-color);
    font-size: 1em;
    line-height: 1.5;
    outline: none;
    resize: vertical;
    box-sizing: border-box;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}
#outline-editor.hidden {
    display: none;
}
#outline-editor:focus {
    border-color: var(--focus-border-color);
    box-shadow: 0 0 5px color-mix(in srgb, var(--focus-border-color) 25%, transparent);
}
#editor {
    border: 1px solid var(--border-color);
    padding: 15px;
    height: 400px;
    overflow-y: auto;
    font-size: 1.2em;
    line-height: 1.6;
    border-radius: 4px;
    outline: none;
    white-space: pre-wrap;
    word-wrap: break-word;
    background-color: var(--editor-bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}
#editor:focus {
    border-color: var(--focus-border-color);
    box-shadow: 0 0 5px color-mix(in srgb, var(--focus-border-color) 25%, transparent);
}
.locked {
    color: var(--locked-text-color);
    pointer-events: none;
}
#stats-bar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 5px;
    font-size: 0.9em;
    color: var(--secondary-text-color);
}
.help-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.help-tooltip sup {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid var(--secondary-text-color);
    text-align: center;
    line-height: 16px;
    font-size: 12px;
    cursor: help;
    margin-left: 5px;
}
.help-tooltip .tooltip-text {
    visibility: hidden;
    opacity: 0;
    width: 240px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 150%;
    left: 50%; 
    transform: translateX(-50%);
    transition: opacity 0.3s;
    font-size: 13px;
    line-height: 1.4;
    pointer-events: none;
}
.help-tooltip .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}
.help-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}
.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}
#modal, #summary-modal {
    background-color: var(--container-bg-color);
    color: var(--text-color);
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    max-width: 400px;
}
#modal h2, #summary-modal h2 { margin-top: 0; }
#modal p { margin-bottom: 25px; color: var(--secondary-text-color); }
#modal .modal-actions button, #summary-modal .modal-actions button {
    padding: 10px 20px;
    margin: 0 10px;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background-color: var(--button-bg);
    color: var(--button-text);
}
#modal-save-new {
    background-color: var(--button-active-bg);
    color: var(--button-active-text);
    border-color: var(--button-active-bg);
}
#modal-discard-new {
    background-color: #e57373;
    color: white;
    border-color: #e57373;
}
.summary-stats {
    text-align: left;
    margin: 20px auto;
    display: inline-block;
}
.summary-stats p {
    margin: 10px 0;
    font-size: 1.1em;
}

#file-actions button:focus-visible, 
#theme-switcher button:focus-visible, 
#lang-switcher button:focus-visible,
.outline-controls button:focus-visible,
#timer-controls button:focus-visible,
.modal-actions button:focus-visible,
#focus-icon:focus-visible {
    outline: 2px solid var(--focus-border-color);
    outline-offset: 2px;
}
.hidden {
    display: none !important;
}
/* 页脚样式 - 核心改动 */
footer {
    width: 100%; /* 页脚宽度占满 */
    margin-top: auto; /* 核心！自动将页脚推到底部 */
    padding: 20px 0; /* 增加一些内边距 */
    text-align: center;
    color: var(--secondary-text-color);
    flex-shrink: 0; /* 防止页脚被压缩 */
}
footer a {
    color: var(--secondary-text-color);
    text-decoration: none;
}
footer a:hover {
    color: var(--text-color);
    text-decoration: underline;
}
.author-credit { text-align: center; color: var(--secondary-text-color); margin: -8px 0 20px; font-size: 14px; }
footer p { margin: 0 0 8px; }
