/**
 * 工作设置面板样式
 */

/* 倒计时卡片内的设置按钮 */
.hero {
  position: relative;
}

.hero-settings-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 10;
}

.hero-settings-btn svg {
  color: var(--text, #e5e9f0);
  opacity: 0.7;
  transition: all 0.2s ease;
}

.hero-settings-btn:hover {
  background: rgba(88, 204, 2, 0.15);
  border-color: var(--brand, #58CC02);
  transform: scale(1.05);
}

.hero-settings-btn:hover svg {
  opacity: 1;
  color: var(--brand, #58CC02);
}

.hero-settings-btn:active {
  transform: scale(0.95);
}

/* 悬停显示逻辑 */
.hero.show-settings .hero-settings-btn {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

/* 浅色主题 */
[data-theme="light"] .hero-settings-btn {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .hero-settings-btn:hover {
  background: rgba(88, 204, 2, 0.12);
  border-color: #58CC02;
}

/* 移动端优化 */
@media (max-width: 768px) {
  .hero-settings-btn {
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    font-size: 20px;
  }
}

/* 预设按钮网格 */
.preset-buttons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

@media (max-width: 768px) {
  .preset-buttons-grid {
    grid-template-columns: 1fr;
  }
}

/* 预设按钮样式 */
.preset-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 16px;
  background: var(--card, #12161b);
  border: 2px solid var(--border, rgba(255, 255, 255, 0.06));
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  min-height: 100px;
}

.preset-btn:hover {
  border-color: var(--brand, #58CC02);
  background: var(--card-hover, #1a1f26);
  transform: translateY(-2px);
}

.preset-btn.active {
  border-color: var(--brand, #58CC02);
  background: linear-gradient(135deg, rgba(88, 204, 2, 0.1), rgba(76, 201, 240, 0.05));
  box-shadow: 0 0 0 1px rgba(88, 204, 2, 0.2);
}

.preset-tag {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(88, 204, 2, 0.15);
  border: 1px solid rgba(88, 204, 2, 0.3);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand, #58CC02);
  margin-bottom: 8px;
  font-family: var(--font-mono, 'Courier New', monospace);
  letter-spacing: 0.5px;
}

.preset-btn.active .preset-tag {
  background: rgba(88, 204, 2, 0.25);
  border-color: var(--brand, #58CC02);
}

.preset-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text, #e5e9f0);
  margin-bottom: 4px;
  display: block;
}

.preset-desc {
  font-size: 13px;
  color: var(--muted, #8892a6);
  line-height: 1.4;
  display: block;
}

/* 工作设置区块 */
.work-settings-section {
  margin-bottom: 24px;
}

.work-settings-section:last-of-type {
  margin-bottom: 0;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text, #e5e9f0);
  margin: 0 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.06));
}

/* 设置行 */
.settings-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 768px) {
  .settings-row {
    grid-template-columns: 1fr;
  }
}

/* 设置标签 */
.settings-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-label .label-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text, #e5e9f0);
}

/* 设置输入框 */
.settings-input {
  padding: 10px 12px;
  background: var(--card, #12161b);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  border-radius: 8px;
  color: var(--text, #e5e9f0);
  font-size: 14px;
  transition: all 0.2s ease;
}

.settings-input:focus {
  outline: none;
  border-color: var(--brand, #58CC02);
  box-shadow: 0 0 0 3px rgba(88, 204, 2, 0.1);
}

.settings-input:hover:not([readonly]) {
  border-color: rgba(255, 255, 255, 0.2);
}

/* 只读输入框样式 */
.settings-input[readonly] {
  background: var(--card-hover, #1a1f26);
  cursor: not-allowed;
  opacity: 0.7;
  border-style: dashed;
}

.settings-input[readonly]:hover {
  border-color: var(--border, rgba(255, 255, 255, 0.12));
}

/* 复选框样式 */
.settings-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 12px;
  background: var(--card, #12161b);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.06));
  border-radius: 8px;
  transition: all 0.2s ease;
}

.settings-checkbox:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: var(--card-hover, #1a1f26);
}

.settings-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--brand, #58CC02);
}

.checkbox-label {
  font-size: 14px;
  color: var(--text, #e5e9f0);
  cursor: pointer;
  user-select: none;
}

/* 预览区域 */
.settings-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(88, 204, 2, 0.05), rgba(76, 201, 240, 0.03));
  border: 1px solid rgba(88, 204, 2, 0.15);
  border-radius: 12px;
}

@media (max-width: 768px) {
  .settings-preview {
    grid-template-columns: 1fr 1fr;
  }
}

.preview-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.preview-label {
  font-size: 12px;
  color: var(--muted, #8892a6);
  font-weight: 500;
}

.preview-value {
  font-size: 16px;
  color: var(--text, #e5e9f0);
  font-weight: 600;
  font-family: var(--font-mono, monospace);
}

/* 操作按钮区域 */
.settings-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.06));
}

@media (max-width: 768px) {
  .settings-actions {
    flex-direction: column-reverse;
  }
  
  .settings-actions button {
    width: 100%;
  }
}

.btn-secondary {
  padding: 12px 24px;
  background: var(--card, #12161b);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  border-radius: 10px;
  color: var(--text, #e5e9f0);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--card-hover, #1a1f26);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-secondary:active {
  transform: translateY(0);
}

/* 提示信息 */
.settings-hint {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(88, 204, 2, 0.05);
  border-left: 3px solid var(--brand, #58CC02);
  border-radius: 6px;
}

.settings-hint p {
  margin: 0;
  font-size: 13px;
  color: var(--muted, #8892a6);
  line-height: 1.5;
}

.settings-hint strong {
  color: var(--text, #e5e9f0);
}

/* Toast 消息样式增强 */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 12px 24px;
  background: var(--card, #12161b);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
  border-radius: 8px;
  color: var(--text, #e5e9f0);
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.success {
  border-color: var(--ok, #22c55e);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.05));
}

.toast.error {
  border-color: var(--danger, #FF6B6B);
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(255, 107, 107, 0.05));
}

/* 浅色主题适配 */
[data-theme="light"] .preset-btn {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .preset-btn:hover {
  background: #f9fafb;
  border-color: var(--brand, #58CC02);
}

[data-theme="light"] .preset-btn.active {
  background: linear-gradient(135deg, rgba(88, 204, 2, 0.08), rgba(76, 201, 240, 0.04));
}

[data-theme="light"] .preset-tag {
  background: rgba(88, 204, 2, 0.12);
  border-color: rgba(88, 204, 2, 0.35);
  color: #3d9600;
}

[data-theme="light"] .preset-btn.active .preset-tag {
  background: rgba(88, 204, 2, 0.2);
  border-color: #58CC02;
}

[data-theme="light"] .settings-input {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.15);
  color: #1a1a2e;
}

[data-theme="light"] .settings-input:hover:not([readonly]) {
  border-color: rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .settings-input[readonly] {
  background: #f9fafb;
  opacity: 0.7;
  border-style: dashed;
}

[data-theme="light"] .settings-input[readonly]:hover {
  border-color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .settings-checkbox {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .settings-checkbox:hover {
  background: #f9fafb;
  border-color: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .settings-preview {
  background: linear-gradient(135deg, rgba(88, 204, 2, 0.08), rgba(76, 201, 240, 0.04));
  border-color: rgba(88, 204, 2, 0.2);
}

[data-theme="light"] .btn-secondary {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.15);
  color: #1a1a2e;
}

[data-theme="light"] .btn-secondary:hover {
  background: #f9fafb;
  border-color: rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .toast {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.15);
  color: #1a1a2e;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* ========================================
   工作时间设置提示卡片
   ======================================== */

.work-settings-prompt {
  margin-top: 20px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(88, 204, 2, 0.08), rgba(88, 204, 2, 0.04));
  border: 1px solid rgba(88, 204, 2, 0.2);
  border-radius: 12px;
  animation: slideInPrompt 0.3s ease-out;
  transition: all 0.3s ease;
}

.work-settings-prompt.hidden {
  display: none;
}

@keyframes slideInPrompt {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.prompt-content {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}

.prompt-icon {
  font-size: 24px;
  margin-right: 10px;
  line-height: 1;
}

.prompt-text {
  flex: 1;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text, #e5e9f0);
  opacity: 0.9;
}

.prompt-actions {
  display: flex;
  gap: 12px;
}

.prompt-btn {
  flex: 1;
  padding: 10px 20px;
  text-align: center;
  font-size: 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.prompt-btn-primary {
  background: var(--brand, #58CC02);
  color: #000;
}

.prompt-btn-primary:hover {
  background: #4db802;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(88, 204, 2, 0.3);
}

.prompt-btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(88, 204, 2, 0.2);
}

.prompt-btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.prompt-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.prompt-btn-secondary:active {
  transform: translateY(0);
}

/* 浅色主题适配 */
[data-theme="light"] .work-settings-prompt {
  background: linear-gradient(135deg, rgba(88, 204, 2, 0.06), rgba(88, 204, 2, 0.02));
  border-color: rgba(88, 204, 2, 0.25);
}

[data-theme="light"] .prompt-text {
  color: rgba(0, 0, 0, 0.85);
}

[data-theme="light"] .prompt-btn-secondary {
  background: rgba(0, 0, 0, 0.04);
  color: rgba(0, 0, 0, 0.7);
  border-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .prompt-btn-secondary:hover {
  background: rgba(0, 0, 0, 0.08);
}

/* 移动端适配 */
@media (max-width: 768px) {
  .work-settings-prompt {
    padding: 14px 16px;
    margin-top: 16px;
  }
  
  .prompt-icon {
    font-size: 20px;
    margin-right: 8px;
  }
  
  .prompt-text {
    font-size: 13px;
  }
  
  .prompt-btn {
    padding: 9px 16px;
    font-size: 13px;
  }
  
  .prompt-actions {
    gap: 10px;
  }
}
