/* Reset */
html, body, main, header, footer {
  padding: 0px;
  margin: 0px;
}

/* App 容器 */
#app {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px;
  box-sizing: border-box;
}

#app-title {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  color: #1a73e8;
  margin: 0 0 20px 0;
}

/* 快捷范围按钮 */
.quick-range-btns {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.quick-btn {
  flex: 1;
  padding: 8px 6px;
  border: 2px solid #dadce0;
  border-radius: 8px;
  background: #ffffff;
  color: #5f6368;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-btn:hover {
  border-color: #1a73e8;
  color: #1a73e8;
  background: #e8f0fe;
}

.quick-btn:active {
  transform: scale(0.97);
}

/* 输入区域 */
.input-area {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 16px;
}

.input-group {
  margin-bottom: 12px;
  position: relative;
}

.input-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #333333;
  margin-bottom: 6px;
}

.input-group input[type="date"] {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #dadce0;
  border-radius: 8px;
  font-size: 16px;
  font-family: Consolas, Monaco, monospace;
  color: #333333;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
  outline: none;
  background: #ffffff;
}

.input-group input[type="date"]:focus {
  border-color: #1a73e8;
}

/* 日期交换按钮 */
.swap-btn {
  display: block;
  width: 100%;
  padding: 8px;
  margin-bottom: 12px;
  border: 1px dashed #dadce0;
  border-radius: 8px;
  background: #f8f9fa;
  color: #5f6368;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.swap-btn:hover {
  border-color: #1a73e8;
  color: #1a73e8;
  background: #e8f0fe;
}

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

/* 错误提示 */
.error-text {
  display: block;
  color: #d93025;
  font-size: 12px;
  margin-top: 4px;
}

/* 选项区域 */
.options-area {
  margin-bottom: 16px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  cursor: pointer;
  font-size: 15px;
  color: #333333;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: #1a73e8;
  cursor: pointer;
  flex-shrink: 0;
}

/* 自定义节假日区域 */
.custom-holidays-area {
  margin-top: 8px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e8eaed;
}

.custom-holidays-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

#custom-holidays-title {
  font-size: 13px;
  font-weight: 600;
  color: #5f6368;
}

.add-holiday-btn {
  padding: 4px 12px;
  border: 1px solid #1a73e8;
  border-radius: 6px;
  background: #ffffff;
  color: #1a73e8;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.add-holiday-btn:hover {
  background: #e8f0fe;
}

.custom-holidays-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.custom-holiday-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: #ffffff;
  border: 1px solid #dadce0;
  border-radius: 20px;
  font-size: 12px;
  font-family: Consolas, Monaco, monospace;
  color: #333333;
}

.remove-holiday-btn {
  border: none;
  background: transparent;
  color: #9aa0a6;
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s ease;
}

.remove-holiday-btn:hover {
  color: #d93025;
}

/* 计算按钮 */
.calc-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: #1a73e8;
  color: #ffffff;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.5em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.calc-btn:hover {
  background: #1557b0;
  transform: scale(1.01);
}

.calc-btn:active {
  transform: scale(0.99);
}

/* 结果区域 */
.result-area {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-bottom: 16px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-card {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 12px;
}

.result-main {
  text-align: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 2px solid #e8eaed;
}

#result-label {
  display: block;
  font-size: 14px;
  color: #5f6368;
  margin-bottom: 4px;
}

.result-value {
  font-size: 40px;
  font-weight: 700;
  color: #1a73e8;
  font-family: Consolas, Monaco, monospace;
}

#result-unit {
  font-size: 18px;
  color: #5f6368;
  margin-left: 4px;
}

.result-detail {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
}

.detail-row:nth-child(odd) {
  background: #ffffff;
}

#detail-total-label,
#detail-weekends-label,
#detail-holidays-label {
  color: #5f6368;
}

.detail-value {
  font-family: Consolas, Monaco, monospace;
  font-weight: 600;
  color: #333333;
}

.detail-row-highlight {
  background: #e8f0fe !important;
  border-radius: 8px;
  margin-top: 4px;
  padding: 10px 12px;
}

#detail-workdays-label {
  color: #1a73e8;
  font-weight: 600;
}

#detail-workdays-value {
  color: #1a73e8;
  font-weight: 700;
  font-size: 16px;
}

/* 复制按钮 */
.copy-btn {
  padding: 8px 20px;
  border: 2px solid #1a73e8;
  border-radius: 8px;
  background: #ffffff;
  color: #1a73e8;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  background: #e8f0fe;
}

.copy-feedback {
  margin-left: 12px;
  color: #188038;
  font-size: 14px;
  font-weight: 500;
}

/* 工具类 */
.hidden {
  display: none;
}

/* 响应式设计 */
@media (max-width: 480px) {
  #app {
    padding: 16px 12px;
  }

  #app-title {
    font-size: 22px;
    margin-bottom: 16px;
  }

  .quick-range-btns {
    gap: 4px;
    flex-wrap: wrap;
  }

  .quick-btn {
    flex: 1 1 calc(50% - 4px);
    font-size: 12px;
    padding: 8px 4px;
  }

  .input-area {
    padding: 14px;
  }

  .input-group input[type="date"] {
    padding: 10px 12px;
    font-size: 15px;
  }

  .calc-btn {
    padding: 12px;
    font-size: 16px;
  }

  .result-value {
    font-size: 32px;
  }

  .checkbox-label {
    font-size: 13px;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  #app {
    padding: 20px 16px;
  }

  #app-title {
    font-size: 24px;
  }

  .quick-btn {
    font-size: 12px;
  }

  .result-value {
    font-size: 36px;
  }
}
