/**
 * QuietHouse v1 - Component Styles
 * 纸笔质感组件 - 去工业化设计
 */

/* ========== Card (卡片 - 纸张风格) ========== */
.card {
  background: transparent;
  border: 1px solid var(--line-gray);
  border-radius: 0;
  padding: 24px;
  margin-bottom: 24px;
  transition: border-color 0.2s ease;
}

.card:hover {
  border-color: var(--pencil-gray);
}

.card-large {
  padding: 36px;
}

.card-small {
  padding: 16px;
}

/* 无边框卡片变体 */
.card-borderless {
  border: none;
  padding: 20px 0;
  border-bottom: 1px solid var(--line-gray);
}

.card-borderless:last-child {
  border-bottom: none;
}

/* ========== Button (按钮 - 文字链接风格) ========== */
.btn {
  display: inline-block;
  padding: 8px 0;
  font-size: 15px;
  font-weight: 400;
  text-align: center;
  text-decoration: none;
  color: var(--ink-black);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-gray);
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
  letter-spacing: 0.05em;
}

.btn:hover {
  color: var(--pure-black);
  border-bottom-color: var(--pure-black);
}

.btn:active {
  opacity: 0.7;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* 线框按钮变体 */
.btn-outline {
  padding: 10px 20px;
  border: 1px solid var(--line-gray);
  border-radius: 0;
}

.btn-outline:hover {
  border-color: var(--ink-black);
}

.btn-small {
  padding: 4px 0;
  font-size: 13px;
}

.btn-large {
  padding: 12px 0;
  font-size: 17px;
}

.btn-block {
  display: block;
  width: 100%;
  text-align: center;
}

/* ========== Input (输入框 - 纸上书写风格) ========== */
.input {
  width: 100%;
  padding: 12px 0;
  font-size: 16px;
  color: var(--ink-black);
  background: transparent;
  border: none;
  outline: none;
  transition: all 0.3s ease;
  letter-spacing: 0.02em;
}

.input::placeholder {
  color: #DDDDDD;
  opacity: 1;
}

.input:focus {
  background: #FCFCFC;
  border-radius: 8px;
  padding: 12px;
}

.input-large {
  font-size: 18px;
  padding: 16px 0;
}

.input-large:focus {
  padding: 16px 12px;
}

/* Textarea variant */
textarea.input {
  resize: vertical;
  min-height: 100px;
  padding: 12px 0;
  line-height: 1.8;
}

textarea.input:focus {
  padding: 12px;
}

/* Select variant */
select.input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888888' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
  padding-right: 20px;
}

/* ========== Tag (标签 - 极简风格) ========== */
.tag {
  display: inline-block;
  padding: 4px 12px;
  font-size: 13px;
  color: var(--pencil-gray);
  background: transparent;
  border: 1px solid var(--line-gray);
  border-radius: 0;
  margin-right: 8px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
  letter-spacing: 0.03em;
}

.tag:hover {
  color: var(--ink-black);
  border-color: var(--ink-black);
}

.tag.active {
  color: var(--paper-white);
  background: var(--ink-black);
  border-color: var(--ink-black);
}

.tag-small {
  padding: 2px 8px;
  font-size: 12px;
}

/* ========== Form Group ========== */
.form-group {
  margin-bottom: 28px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--pencil-gray);
  letter-spacing: 0.05em;
}

/* ========== Divider (分隔线) ========== */
.divider {
  height: 1px;
  background: var(--line-gray);
  margin: 36px 0;
  border: none;
}

/* ========== List (列表) ========== */
.list-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--line-gray);
  transition: padding 0.2s ease;
}

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

.list-item:hover {
  padding-left: 12px;
}

/* ========== Badge (徽章) ========== */
.badge {
  display: inline-block;
  min-width: 20px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 400;
  text-align: center;
  color: var(--pencil-gray);
  background: transparent;
  border: 1px solid var(--line-gray);
  border-radius: 0;
}

/* ========== Empty State (空状态) ========== */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--pencil-gray);
}

.empty-state-icon {
  font-size: 36px;
  margin-bottom: 16px;
  opacity: 0.3;
  font-weight: 300;
}

/* ========== Spacing Adjustments (增加间距) ========== */
.card + .card {
  margin-top: 32px;
}

.btn + .btn {
  margin-left: 20px;
}

/* ========== Focus States ========== */
:focus-visible {
  outline: 1px solid var(--ink-black);
  outline-offset: 2px;
}

/* ========== Hover Effects (极简) ========== */
button:hover,
a:hover {
  transition: all 0.15s ease;
}

/* ========== Edit Form Save Button (Icon Only) ========== */
.btn-edit-save {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #2C2C2C !important; /* 确保背景黑 */
  color: #FFFFFF !important; /* 确保前景白 */
  border: none;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(44, 44, 44, 0.2);
  transition: transform 0.2s ease, background-color 0.2s;
}

/* 确保 SVG 继承白色 */
.btn-edit-save svg {
  stroke: currentColor;
  width: 20px;
  height: 20px;
}

.btn-edit-save:hover {
  background-color: #000000 !important;
  transform: scale(1.05);
}
