/* 倒计时组件样式 */

/* 主题适配 */
body.theme-native .countdown { 
  border: 2px solid var(--border); 
  border-radius: 8px; 
}

/* 倒计时容器样式 */
.countdown {
  margin: 2px 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  position: relative;
}

.add-countdown-btn {
  /* 继承主页面的统一组件按钮样式 */
  font-size: 18px; /* 加号按钮稍大一些 */
}

.countdown-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.countdown-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  flex: 1;
  min-width: 0;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
}

.countdown-item:first-child {
  border-width: 2px;
  font-weight: 600;
}

.countdown-title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  width: 100%;
  text-align: center;
  transition: font-size 0.3s ease;
}

.countdown-time {
  font-size: 18px;
  font-weight: bold;
  line-height: 1.2;
}

/* 自定义倒计时弹窗 */
.countdown-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: clamp(10px, 3vw, 20px);
}

.countdown-modal.show {
  display: flex;
}

.modal-content {
  background: var(--bg);
  border: 2px solid var(--fg);
  border-radius: 8px;
  width: 100%;
  max-width: clamp(300px, 90vw, 400px);
  max-height: clamp(400px, 85vh, 600px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(12px, 3vw, 16px);
  border-bottom: 1px solid var(--fg);
  flex-shrink: 0;
}

.modal-title {
  margin: 0;
  font-size: clamp(16px, 4vw, 18px);
  font-weight: 600;
  color: var(--fg);
}

/* 弹窗内容区域 */
.modal-body {
  padding: clamp(12px, 3vw, 16px);
  overflow-y: auto;
  flex: 1;
}

/* 弹窗底部按钮区域 */
.modal-footer {
  padding: clamp(12px, 3vw, 16px);
  border-top: 1px solid var(--fg);
  display: flex;
  justify-content: center;
  gap: clamp(8px, 2vw, 12px);
  flex-shrink: 0;
}

.form-group {
  margin-bottom: clamp(12px, 3vw, 16px);
}

.form-label {
  display: block;
  margin-bottom: clamp(4px, 1vw, 6px);
  font-size: clamp(14px, 3vw, 16px);
  font-weight: 600;
  color: var(--fg);
}

.form-input {
  width: 100%;
  padding: clamp(8px, 2vw, 12px);
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  font-size: clamp(14px, 3vw, 16px);
  min-height: 40px;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--fg);
}

.form-input::placeholder {
  color: var(--fg);
  opacity: 0.6;
}

.btn-group {
  display: flex;
  gap: clamp(8px, 2vw, 12px);
  justify-content: center;
  margin-top: clamp(16px, 4vw, 20px);
}

.btn {
  padding: clamp(8px, 2vw, 12px) clamp(16px, 4vw, 20px);
  border: 2px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  cursor: pointer;
  font-size: clamp(14px, 3vw, 16px);
  font-weight: 500;
  min-height: 40px;
  min-width: clamp(60px, 15vw, 80px);
  transition: all 0.2s ease;
}

.btn:hover {
  border-color: var(--fg);
  opacity: 0.8;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--fg);
  color: var(--bg);
  border: 2px solid var(--fg);
}

.btn-primary:hover {
  opacity: 0.9;
  border-color: var(--fg);
}

.btn-primary:active {
  transform: scale(0.98);
}

.custom-countdown-list {
  margin-top: 20px;
}

.custom-countdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 8px;
  background: var(--bg);
}

.custom-countdown-info {
  flex: 1;
}

.custom-countdown-name {
  font-weight: 500;
  margin-bottom: 2px;
}

.custom-countdown-date {
  font-size: 14px;
}

.custom-countdown-actions {
  display: flex;
  gap: 5px;
}

/* 操作反馈提示样式 */
.feedback-message {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg);
  color: var(--fg);
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  z-index: 2000;
  display: none;
  border: 3px solid var(--border);
}

/* 小屏幕响应式设计 */
@media (max-width: 768px) {
  .countdown-modal {
    padding: 10px;
  }
  
  .modal-content {
    width: 95vw;
    max-width: 350px;
    max-height: 90vh;
  }
  
  .modal-header {
    padding: 12px;
  }
  
  .modal-title {
    font-size: 16px;
  }
  
  .modal-body {
    padding: 12px;
  }
  
  .modal-footer {
    padding: 12px;
    gap: 8px;
  }
  
  .form-group {
    margin-bottom: 12px;
  }
  
  .form-label {
    font-size: 14px;
    margin-bottom: 4px;
  }
  
  .form-input {
    padding: 10px;
    font-size: 14px;
    min-height: 36px;
  }
  
  .btn {
    padding: 8px 12px;
    font-size: 14px;
    min-height: 36px;
    min-width: 60px;
  }
  
  .btn-group {
    gap: 8px;
    margin-top: 16px;
  }
  
  .custom-countdown-item {
    padding: 8px;
    margin-bottom: 6px;
  }
  
  .custom-countdown-name {
    font-size: 14px;
  }
  
  .custom-countdown-date {
    font-size: 12px;
  }
}

/* 确保表单输入框不会溢出容器 */
.form-input {
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* 修复关闭按钮样式 */
.modal-header .close-btn {
  background: none;
  border: none;
  color: var(--fg);
  font-size: 20px;
  padding: 0;
  min-height: auto;
  min-width: auto;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.modal-header .close-btn:hover {
  opacity: 0.7;
  border: none;
}