/* =============================================
    样式总览（模块化重构版）
    - 目标：统一样式来源，消除重复定义与覆盖冲突
    - 依据：/docs/construction/blueprint.md 与 /docs/construction/注释规范.md
    - 结构：基础 → 布局 → 组件 → 弹窗 → 编辑模式 → 杂项
    ============================================= */

/* 1. 基础与重置（Base & Reset） */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Microsoft YaHei', sans-serif; min-height: 100vh; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.hidden { display: none; }

/* 2. 页面框架（Layout） */
.container { width: 100%; min-height: 100vh; padding-top: 60px; box-sizing: border-box; }
header { background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%); color: white; padding: 10px 20px; display: flex; height: 60px; justify-content: space-between; align-items: center; position: fixed; top: 0; left: 0; right: 0; z-index: 1000; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); }
h1 { font-size: 1.5em; font-weight: normal; cursor: pointer; transition: color 0.3s ease; }
#appTitleText:hover { color: #3498db; }
.header-buttons { display: flex; gap: 10px; }
.header-btn { padding: 8px 16px; background: rgba(255, 255, 255, 0.2); color: white; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 20px; cursor: pointer; font-size: 0.9em; transition: all 0.3s ease; }
.header-btn:hover { background: rgba(255, 255, 255, 0.3); }
.info-icon, .stats-icon { font-size: 0.8em; margin-left: 8px; cursor: pointer; opacity: 0.85; }
.info-icon:hover, .stats-icon:hover { opacity: 1; }

/* 语言切换器样式 */
.language-switcher { position: relative; display: inline-block; }
.language-btn { background: rgba(255, 255, 255, 0.2); color: white; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 20px; cursor: pointer; font-size: 1.1em; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; transition: all 0.3s ease; }
.language-btn:hover { background: rgba(255, 255, 255, 0.3); transform: scale(1.05); }
.language-dropdown { position: absolute; top: 100%; right: 0; background: white; border-radius: 8px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); min-width: 140px; z-index: 1001; display: none; margin-top: 5px; overflow: hidden; }
.language-dropdown.show { display: block; animation: dropdownSlideIn 0.2s ease-out; }
@keyframes dropdownSlideIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.language-option { display: block; width: 100%; padding: 10px 15px; background: none; border: none; text-align: left; cursor: pointer; font-size: 0.9em; color: #2c3e50; transition: background 0.2s ease; border-bottom: 1px solid #f0f0f0; }
.language-option:last-child { border-bottom: none; }
.language-option:hover { background: #f8f9fa; }
.language-option.active { background: #3498db; color: white; }
.language-option.current-language { background: #e8f4fd; color: #2980b9; font-weight: 600; border-left: 3px solid #3498db; }

/* 每日完成时长进度条样式 */
.daily-progress-container { 
    position: absolute; 
    left: 50%; 
    transform: translateX(-50%); 
    width: 300px; 
    height: 24px; 
    z-index: 1000; 
}
.progress-bar { 
    width: 100%; 
    height: 18px; 
    background: #cdd1d8; 
    border-radius: 12px; 
    position: relative; 
    overflow: hidden;
    border: 1px solid #e1e8ed; 
}

.progress-info {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
    margin-bottom: -4px;
    font-size: 0.65rem;
    color: #95a5a6;
    line-height: 1;
    position: relative;
}

.current-progress-time {
    position: absolute;
    left: 0%;
    white-space: nowrap;
    transform: translateX(-50%);
    transition: left 0.5s ease;
}
.progress-fill { 
    height: 100%; 
    border-radius: 12px; 
    width: 0%; 
    transition: width 0.5s ease, background 0.5s ease; 
    position: relative; 
    /* 默认未达标渐变：深红到浅红 */
    background: linear-gradient(90deg, #c0392b, #e74c3c);
}
.progress-fill.reached { 
    /* 已达标渐变：浅绿到深绿 */
    background: linear-gradient(90deg, #27ae60, #2ecc71);
}
.baseline-marker { 
    position: absolute; 
    top: 0; 
    height: 100%; 
    width: 1px;
    background-color: #ff786a;
    z-index: 2; 
    box-shadow: 0 0 5px rgba(231, 76, 60, 0.7);
    left: 50%; /* 12小时分界线位置 */
}
.baseline-marker.reached { 
    background-color: #2ecc71; 
    box-shadow: 0 0 5px rgba(46, 204, 113, 0.7); 
}
.progress-tooltip { 
    position: absolute; 
    background: rgba(0, 0, 0, 0.8); 
    color: white; 
    padding: 8px 12px; 
    border-radius: 6px; 
    font-size: 0.85rem; 
    z-index: 10; 
    pointer-events: none; 
    opacity: 0; 
    transition: opacity 0.3s; 
    white-space: nowrap; 
    top: 100%;
    margin-top: 8px;
    left: 50%;
    transform: translateX(-50%);
}
.progress-tooltip.show {
    opacity: 1;
}

/* 进度条测试按钮样式 */
.progress-test-buttons {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    justify-content: center;
}

.test-btn {
    padding: 6px 12px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.3s ease;
    opacity: 0.8;
}

.test-btn:hover {
    background: #2980b9;
    opacity: 1;
    transform: translateY(-1px);
}

.test-btn:active {
    transform: translateY(0);
}
.main-content { display: flex; height: calc(100vh - 60px); align-items: stretch; overflow: hidden; }
#homePage, #countdownPage { display: none; }
#homePage.active, #countdownPage.active { display: block; }
#countdownPage { background: white; }

/* 3. 网格与分类（Grid & Categories） */
.states-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; padding: 20px; background: #f8f9fa; }
.state-category { background: white; padding: 15px; border-radius: 10px; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08); transition: transform 0.3s ease; }
.state-category:hover { transform: translateY(-2px); }
.category-header { font-size: 1.1em; font-weight: bold; color: #2c3e50; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid #e74c3c; display: flex; justify-content: space-between; align-items: center; }
.category-actions { display: flex; gap: 8px; }
.category-name { font-size: 1.1em; font-weight: bold; cursor: pointer; padding: 4px 8px; border-radius: 4px; transition: background 0.3s ease; }

/* 4. 状态项（State Items） */
.state-item { display: flex; justify-content: space-between; align-items: center; padding: 12px; margin: 8px 0; background: #f8f9fa; border-radius: 6px; cursor: pointer; transition: all 0.3s ease; border: 1px solid transparent; }
.state-item:hover { background: #e9ecef; transform: translateY(-1px); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); }
.state-item.active { background: #e74c3c; color: white; border-color: #c0392b; }
.state-item.dragging { opacity: 0.5; background: rgba(52, 152, 219, 0.1); }
.state-info { display: flex; align-items: center; gap: 10px; flex: 1; }
.state-emoji { font-size: 1.2em; }
.state-name { font-weight: 500; }
.state-actions { display: flex; gap: 6px; }
.music-btn, .image-btn { background: #3498db; color: white; border: none; padding: 6px 10px; border-radius: 4px; cursor: pointer; font-size: 0.9em; transition: background 0.3s ease; }
.music-btn:hover, .image-btn:hover { background: #2980b9; }

/* 5. 控制面板与展示区（Control Panel & Display） */
.control-panel { padding: 0; flex: 3; }
.control-panel.right { background: white; margin-bottom: 0; padding: 25px; display: flex; flex-direction: column; justify-content: center; align-items: center; position: relative; height: 100%; min-height: 100%; overflow: hidden; flex: 2; }
#stateImage { height: 100%; display: flex; align-items: center; justify-content: center; color: white; font-size: 3em; position: relative; overflow: hidden; box-sizing: border-box; background: transparent; }
#stateImageImg { width: 100%; height: 100%; object-fit: cover; display: none; position: absolute; top: 0; left: 0; right: 0; bottom: 0; }
#stateImageEmoji { font-size: 3em; display: none; z-index: 1; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
#stateName { font-size: 3em; font-weight: bold; color: #2c3e50; margin-bottom: 5px; text-align: center; }
#stateDesc { color: #7f8c8d; text-align: center; margin-bottom: 20px; font-size: 1em; }
#countdownDisplay { font-size: 3em; font-weight: bold; color: #2c3e50; font-family: 'Courier New', monospace; margin: 15px 0; }
.replay-btn { padding: 12px 24px; background: #3498db; color: white; border: none; border-radius: 8px; cursor: pointer; font-size: 1.1em; margin-top: 20px; transition: all 0.3s ease; }
.replay-btn:hover { background: #2980b9; transform: translateY(-2px); }
.replay-btn.hidden { display: none; }
.exit-fullscreen-btn { position: absolute; bottom: 0; right: 0; background: none; border: none; font-size: 1.5em; cursor: pointer; padding: 10px; color: #666; opacity: 0.7; transition: opacity 0.2s ease; }
.exit-fullscreen-btn:hover { opacity: 1; }
.completion-count { position: absolute; top: 20px; right: 20px; font-size: 0.9em; color: #95a5a6; background: rgba(236, 240, 241, 0.9); padding: 6px 12px; border-radius: 12px; border: 1px solid #bdc3c7; }

/* 6. 弹窗（Modals） */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); z-index: 1001; }
.modal-content { background: white; margin: 60px auto; padding: 20px; border-radius: 10px; width: 90%; max-width: 400px; max-height: 90vh; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3); animation: modalSlideIn 0.3s ease-out; }
@keyframes modalSlideIn { from { transform: translateY(-30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 2px solid #eee; }
.close-btn { background: none; border: none; font-size: 1.3em; cursor: pointer; color: #999; transition: color 0.3s ease; }
.close-btn:hover { color: #333; }
.modal-content p { margin: 10px 0; color: #34495e; line-height: 1.8; }
.modal-content h2, .modal-content h3 { margin: 16px 0 8px; color: #2c3e50; }
.modal-content ul { margin: 8px 0 12px 20px; }
.modal-content li { color: #7f8c8d; line-height: 1.8; }
.modal-content code { background: #f0f3f6; border-radius: 4px; padding: 0 4px; }
.modal-content a { color: #2c3e50; text-decoration: underline; }
.md-table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.md-table th, .md-table td { border: 1px solid #eee; padding: 6px 8px; }
.md-table th { background: #f8f9fa; color: #2c3e50; }
#fullAboutContent { padding-bottom: 16px; }
#aboutContent { padding-bottom: 12px; }
#welcomeContent { padding-bottom: 12px; }

/* 8. 统计模块样式 */
.stats-modal-content {
    max-width: 800px;
    max-height: 92vh;
    background: white;
}

.stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.stats-filters {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-size: 0.8em;
    color: #6c757d;
    font-weight: bold;
}

.filter-select {
    padding: 6px 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.filter-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.date-range-input {
    padding: 6px 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23666" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>');
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 30px;
}

.date-range-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.date-range-input:hover {
    border-color: #adb5bd;
}

/* 日期范围选择器样式 */
.date-range-picker-container {
  position: relative;
}

.date-range-picker {
  position: absolute;
  top: 100%;
  left: 0;
  width: 280px;
  background: white;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  margin-top: 5px;
}

.date-range-calendar {
  padding: 10px;
  border-bottom: 1px solid #e9ecef;
}

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

.current-month {
  font-weight: bold;
  font-size: 1em;
  color: #495057;
}

.prev-month-btn, .next-month-btn {
  background: none;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 1em;
  color: #6c757d;
  transition: all 0.3s ease;
}

.prev-month-btn:hover, .next-month-btn:hover {
  background: #f8f9fa;
  border-color: #3498db;
  color: #3498db;
}

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

.calendar-day-header {
  text-align: center;
  font-size: 0.8em;
  color: #6c757d;
  padding: 5px 0;
  font-weight: bold;
}

.calendar-day {
  text-align: center;
  padding: 6px 0;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.3s ease;
  font-size: 0.85em;
}

.calendar-day:hover {
  background: #e9ecef;
}

.calendar-day.other-month {
  color: #adb5bd;
}

.calendar-day.selected {
  background: #3498db;
  color: white;
}

.calendar-day.in-range {
  background: #e3f2fd;
  color: #1976d2;
}

.calendar-day.start-date {
  background: #1976d2;
  color: white;
  border-radius: 4px 0 0 4px;
}

.calendar-day.end-date {
  background: #1976d2;
  color: white;
  border-radius: 0 4px 4px 0;
}



.date-inputs {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

.date-input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.date-input-group label {
    font-size: 0.9em;
    color: #495057;
    font-weight: bold;
}

.date-input {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
    font-size: 0.9em;
    width: 100%;
}

.date-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.date-range-presets {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.preset-btn {
    padding: 6px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.3s ease;
    color: #495057;
}

.preset-btn:hover {
    background: #e9ecef;
    border-color: #3498db;
}

.preset-btn.active {
    background: #3498db;
    color: white;
    border-color: #2980b9;
}

.date-range-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 10px;
}

.apply-date-btn {
    padding: 8px 16px;
    background: #3498db;
    color: white;
    border: 1px solid #2980b9;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s ease;
}

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

.cancel-date-btn {
    padding: 8px 16px;
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s ease;
}

.cancel-date-btn:hover {
    background: #e9ecef;
}

.custom-date-btn {
    padding: 6px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
    color: #495057;
    white-space: nowrap;
}

.custom-date-btn:hover {
    background: #e9ecef;
    border-color: #3498db;
}

.custom-date-range {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.date-range-inputs {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.date-input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.date-input-group label {
    font-size: 0.8em;
    color: #6c757d;
    font-weight: bold;
}

.date-input {
    padding: 6px 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
    font-size: 0.9em;
}

.apply-date-btn, .cancel-date-btn {
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s ease;
}

.apply-date-btn {
    background: #3498db;
    color: white;
    border-color: #2980b9;
}

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

.cancel-date-btn {
    background: #f8f9fa;
    color: #495057;
}

.cancel-date-btn:hover {
    background: #e9ecef;
}

.stats-notice {
    font-size: 0.85em;
    color: #6c757d;
    font-style: italic;
}

.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stats-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.stats-card-title {
    font-size: 0.9em;
    color: #6c757d;
    margin-bottom: 8px;
}

.stats-card-value {
    font-size: 1.5em;
    font-weight: bold;
    color: #3498db;
}

.stats-chart-container {
    background: #f8f9fa;
    padding: 10px 5px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px solid #e9ecef;
    height: 300px;
    position: relative;
}

.chart-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.reset-zoom-btn {
  background: rgba(255, 255, 255, 0.9);
  border: 0.5px solid #ddd;
  border-radius: 4px;
  padding: 6px;
  color: #666;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
}

.reset-zoom-btn:hover {
  background: rgba(255, 255, 255, 1);
  border-color: #999;
  color: #333;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stats-records {
    margin-bottom: 15px;
}

.stats-records h3 {
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 1.1em;
}

.stats-records-list {
    max-height: 140px;
    overflow-y: auto;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 0;
    border: 1px solid #e9ecef;
    position: relative;
}

.stats-record-item {
    padding: 8px;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.85em;
}

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

.record-grid-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    align-items: center;
    padding: 8px;
    font-weight: bold;
    font-size: 0.8em;
    color: #6c757d;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    position: sticky;
    top: 0;
    margin-top: 0;
}

.record-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    align-items: center;
}

.record-time {
    color: #6c757d;
    font-size: 0.8em;
    text-align: left;
}

.record-duration {
    color: #3498db;
    font-weight: bold;
    font-size: 0.85em;
    text-align: center;
}

.record-status {
    font-size: 0.75em;
    padding: 2px 6px;
    border-radius: 8px;
    text-align: center;
    min-width: 50px;
}

.record-time-header {
    text-align: left;
}

.record-duration-header {
    text-align: center;
}

.record-status-header {
    text-align: center;
}

.stats-record-item .record-status.completed {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.stats-record-item .record-status.incomplete {
    background: rgba(255, 193, 7, 0.2);
    color: #FFC107;
}

.no-records {
    text-align: center;
    padding: 30px;
    color: #6c757d;
    font-style: italic;
}

/* 7. 按钮与表单（Buttons & Forms） */
.add-btn { background: #27ae60; color: white; border: none; padding: 10px 20px; border-radius: 6px; cursor: pointer; font-size: 1em; transition: background 0.3s ease; }
.add-btn:hover { background: #219653; }
.add-btn.small { padding: 8px 16px; font-size: 0.9em; }
.delete-btn { background: #e74c3c; color: white; border: none; padding: 6px 12px; border-radius: 4px; cursor: pointer; font-size: 0.9em; transition: background 0.3s ease; }
.delete-btn:hover { background: #c0392b; }
.delete-btn.small { padding: 4px 8px; font-size: 0.8em; }
.form-group { margin-bottom: 12px; }
.form-group label { display: block; margin-bottom: 4px; font-weight: bold; color: #2c3e50; font-size: 0.9em; }
.form-group input, .form-group select { width: 100%; padding: 8px; border: 2px solid #ddd; border-radius: 5px; font-size: 0.95em; transition: all 0.3s ease; }
.form-group input:focus, .form-group select:focus { border-color: #3498db; outline: none; box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1); }
.form-group textarea { width: 100%; padding: 8px; border: 2px solid #ddd; border-radius: 5px; font-size: 0.95em; transition: all 0.3s ease; resize: vertical; min-height: 60px; }
.form-group textarea:focus { border-color: #3498db; outline: none; box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1); }
.save-btn { width: 100%; padding: 10px; background: #27ae60; color: white; border: none; border-radius: 5px; cursor: pointer; font-size: 1em; margin-top: 10px; transition: background 0.3s ease; }
.save-btn:hover { background: #219653; }
.form-buttons { display: flex; gap: 10px; margin-top: 15px; }
.form-buttons .save-btn { flex: 1; margin-top: 0; }
.form-buttons .header-btn { flex: 1; background: #95a5a6; color: white; border: none; border-radius: 5px; padding: 10px; cursor: pointer; font-size: 1em; transition: background 0.3s ease; }
.form-buttons .header-btn:hover { background: #7f8c8d; }

/* 8. 调试按钮（Debug Spider） */
.debug-spider { position: fixed; bottom: 18px; right: 140px; width: 32px; height: 32px; cursor: pointer; opacity: 0.6; transition: all 0.3s ease; z-index: 1001; display: flex; align-items: center; justify-content: center; font-size: 15px; background: transparent; border: none; }
.debug-spider.debug-enabled { opacity: 0.8; }
.debug-spider:hover { opacity: 1; transform: scale(1.1); }
.debug-spider.active { background: radial-gradient(circle, #4CAF50 20%, transparent 20%), radial-gradient(circle, #4CAF50 20%, transparent 20%) 16px 16px, radial-gradient(circle, #4CAF50 20%, transparent 20%) 0px 16px, radial-gradient(circle, #4CAF50 20%, transparent 20%) 16px 0px; background-size: 8px 8px; background-position: 0 0, 4px 4px; border-color: #4CAF50; box-shadow: 0 0 10px rgba(76, 175, 80, 0.5); }
.debug-spider::before { content: '调试'; position: absolute; top: -25px; left: 50%; transform: translateX(-50%); background: rgba(0, 0, 0, 0.8); color: white; padding: 2px 6px; border-radius: 3px; font-size: 10px; white-space: nowrap; opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.debug-spider:hover::before { opacity: 1; }

/* 9. 编辑模式（Edit Mode） */
.edit-mode .state-category { border: 2px dashed #3498db; background: rgba(52, 152, 219, 0.05); }
.category-header { display: flex; justify-content: space-between; align-items: center; padding: 10px; background: #f8f9fa; border-radius: 6px; margin-bottom: 10px; }
.category-name { font-size: 1.1em; font-weight: bold; cursor: pointer; padding: 4px 8px; border-radius: 4px; transition: background 0.3s ease; }
.edit-mode .category-name:hover { background: rgba(52, 152, 219, 0.1); }
.category-actions { display: flex; gap: 8px; }

/* 10. 编辑模式状态项样式 */
.edit-mode .state-item { cursor: move; border: 1px dashed #95a5a6; }
.edit-mode .state-item:hover { border-color: #3498db; background: rgba(52, 152, 219, 0.05); }

/* 11. 浮动按钮样式 */
.floating-btn { position: fixed; bottom: 20px; right: 20px; z-index: 1002; background: rgba(200, 200, 200, 0.15); color: #666; border: none; padding: 6px 12px; border-radius: 16px; cursor: pointer; font-size: 11px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); transition: all 0.3s ease; opacity: 0.6; white-space: nowrap; }
.floating-btn:hover { background: rgba(200, 200, 200, 0.25); color: #555; transform: translateY(-1px); box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12); opacity: 0.9; }

/* 12. 添加分类按钮 - 仅在编辑模式下显示 */
.add-category-btn { display: none; text-align: center; margin-bottom: 20px; padding: 20px; border: 2px dashed #95a5a6; border-radius: 8px; background: rgba(149, 165, 166, 0.05); cursor: pointer; transition: all 0.3s ease; }
.add-category-btn:hover { border-color: #3498db; background: rgba(52, 152, 219, 0.05); }

/* 13. 添加状态按钮区域 */
.add-state-btn { text-align: center; margin: 10px 0; padding: 15px; border: 2px dashed #95a5a6; border-radius: 6px; background: rgba(149, 165, 166, 0.05); cursor: pointer; transition: all 0.3s ease; }
.add-state-btn:hover { border-color: #3498db; background: rgba(52, 152, 219, 0.05); }

/* 14. 编辑模式下显示添加分类按钮和浮动按钮 */
body.edit-mode .add-category-btn { display: block; }
body.edit-mode .floating-btn { display: block; }

/* 15. 特定ID的浮动按钮位置调整 */
#aboutFloatingBtn { right: 80px; }

/* 16. 时间线（Timeline） */
.timeline-list { display: flex; flex-direction: column; gap: 12px; max-height: 60vh; overflow-y: auto; }
.timeline-item { padding: 12px; background: #f8f9fa; border-radius: 8px; border: 1px solid #e9ecef; position: relative; }
.timeline-item::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #3498db; border-radius: 2px; }
.timeline-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.timeline-version { background: #3498db; color: white; padding: 2px 8px; border-radius: 12px; font-size: 0.8em; font-weight: bold; }
.timeline-date { color: #7f8c8d; font-size: 0.9em; }
.timeline-title { font-weight: bold; color: #2c3e50; margin-bottom: 4px; font-size: 1em; }
.timeline-notes { color: #7f8c8d; font-size: 0.9em; line-height: 1.4; padding-left: 15px; }

/* 17. 工具类 */
.flex-col-8 { display: flex; flex-direction: column; gap: 8px; }
.flex-col-10 { display: flex; flex-direction: column; gap: 10px; }
.header-btn--gray { background: #666; color: white; }

/* 18. 细微按钮样式 */
.subtle-btn { opacity: 0.7; font-size: 0.8em; }
.subtle-btn:hover { opacity: 1; }

/* 19. 模态框内容容器样式 */
.modal-content-lg { max-width: 900px; }
.modal-content-md { max-width: 520px; }
.content-container { display: flex; flex-direction: column; gap: 10px; }
.content-container-sm { display: flex; flex-direction: column; gap: 8px; }
.content-scrollable { color: #2c3e50; line-height: 1.7; overflow-y: auto; }
.content-scrollable-lg { max-height: 68vh; }
.content-scrollable-md { max-height: 50vh; }
.content-scrollable-sm { max-height: 40vh; }

/* 20. 设置按钮样式 */
.settings-section-btn { background: #666 !important; color: white !important; }

/* 21. 信息显示样式 */
.current-info-container { margin-top: 15px; padding: 10px; background: #f8f9fa; border-radius: 5px; display: none; }

/* 22. 表情选择器容器 */
.emoji-picker-wrapper { position: fixed; z-index: 1002; display: none; }

/* 23. 输入组样式 */
.form-input-group { display: flex; gap: 10px; align-items: center; }

/* 24. 通知样式 */
.notification {
  position: fixed;
  top: 80px;
  right: 20px;
  padding: 15px 20px;
  border-radius: 5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
  color: white;
}
.notification.success { background-color: #27ae60; }
.notification.error { background-color: #e74c3c; }

/* 25. 预览容器样式 */
#preview-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border: 2px solid #3498db;
  border-radius: 8px;
  padding: 20px;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  max-width: 300px;
  max-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -50px;
}

/* 26. 表情选择器样式 */
emoji-picker {
  width: 320px;
  height: 320px;
}

/* 27. 表单输入样式 */
.form-input-short {
  width: 60px;
  border: 1px solid #3498db;
  border-radius: 4px;
  padding: 4px 8px;
  background: white;
}
.form-input-medium {
  width: 200px;
  border: 1px solid #3498db;
  border-radius: 4px;
  padding: 4px 8px;
  background: white;
}
.form-input-full {
  flex: 1;
  border: 1px solid #3498db;
  border-radius: 4px;
  padding: 4px 8px;
  background: white;
}

/* 28. 预览内容样式 */
.preview-content {
  text-align: center;
}
.preview-icon {
  font-size: 48px;
  margin-bottom: 10px;
}
.preview-title {
  font-weight: bold;
  margin-bottom: 10px;
}
.preview-subtitle {
  font-size: 12px;
  color: #666;
  margin-top: 5px;
}
.preview-audio {
  margin-top: 10px;
  width: 100%;
}

/* 音乐、图片按钮颜色对齐备份版本 */
.music-btn { background: #9b59b6; color: white; }
.music-btn:hover { background: #8e44ad; }
.image-btn { background: #1abc9c; color: white; }
.image-btn:hover { background: #16a085; }

/* 29. 设置区域样式 */
.settings-section {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 10px;
  border: 1px solid #e9ecef;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #e9ecef;
}

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

.setting-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  color: #2c3e50;
  min-width: 150px;
}

.setting-icon {
  font-size: 1.1em;
  opacity: 0.8;
}

/* 设置项控件样式 */
.setting-item select {
  width: 150px;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 6px 8px;
  background: white;
  font-size: 0.9em;
  transition: all 0.2s ease;
}

.setting-item input[type="file"] {
  width: 150px;
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  padding: 6px 8px;
  background: #f8f9fa;
  font-size: 0.9em;
  transition: all 0.3s ease;
  cursor: pointer;
}

.setting-item input[type="file"]::file-selector-button {
  display: none;
}

.setting-item select:focus,
.setting-item input[type="file"]:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.setting-item select:hover,
.setting-item input[type="file"]:hover {
  border-color: #3498db;
}

/* 开关样式 */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 24px;
}

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

input:checked + .toggle-slider {
  background-color: #3498db;
}

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

input:focus + .toggle-slider {
  box-shadow: 0 0 1px #3498db;
}

.toggle-switch:hover .toggle-slider {
  background-color: #b3b3b3;
}

input:checked:hover + .toggle-slider {
  background-color: #2980b9;
}

/* 专注时长输入框样式 */
.duration-input {
  width: 80px;
  border: 1px solid #3498db;
  border-radius: 4px;
  padding: 6px 8px;
  background: white;
  font-size: 0.9em;
  text-align: center;
}

.duration-input:focus {
  outline: none;
  border-color: #2980b9;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

/* 设置操作按钮样式 */
.settings-action-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  color: #495057;
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 120px;
}

.settings-action-btn:hover {
  background: #e9ecef;
  border-color: #3498db;
  color: #3498db;
}

.settings-action-btn:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}





.edit-btn { background: #f39c12; color: white; border: none; padding: 6px 10px; border-radius: 4px; cursor: pointer; font-size: 0.9em; transition: background 0.2s ease; }
.edit-btn:hover { background: #e67e22; }
/* 音乐、图片按钮颜色对齐备份版本 */
.music-btn { background: #9b59b6; color: white; }
.music-btn:hover { background: #8e44ad; }
.image-btn { background: #1abc9c; color: white; }
.image-btn:hover { background: #16a085; }
