/* 工具层 - 拼音标注工具的界面组件与 ruby 结果样式 */

/* 页面标题区 */
.page-hero {
  margin-bottom: 24px;
}

.page-hero h1 {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 10px;
}

.page-hero .subtitle {
  color: var(--color-text-secondary);
  font-size: 16px;
  line-height: 1.7;
  max-width: 640px;
}

/* 标题上方的小徽章 */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  margin-bottom: 14px;
  background: var(--color-primary-soft);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-primary-dark);
  font-size: 13px;
  font-weight: 600;
}

/* 工具卡片 */
.tool-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 28px;
}

/* 输入区 */
.input-area textarea {
  width: 100%;
  min-height: 150px;
  padding: 16px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 18px;
  line-height: 1.7;
  resize: vertical;
  font-family: inherit;
  color: var(--color-text);
  background: #fff;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.input-area textarea::placeholder {
  color: #b0b6c0;
}

.input-area textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.12);
}

/* 操作工具栏 */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin: 18px 0;
}

.toolbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* 选项区：暖色浅底面板 */
.options {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fffaf4;
  margin-bottom: 20px;
}

.option-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.option-group label {
  font-size: 14px;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.option-group .value-tag {
  min-width: 42px;
  font-size: 13px;
  color: var(--color-text-secondary);
}

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

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

.switch .slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 22px;
  transition: 0.2s;
  cursor: pointer;
}

.switch .slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}

.switch input:checked + .slider {
  background: var(--color-primary);
}

.switch input:checked + .slider::before {
  transform: translateX(18px);
}

/* 结果区 */
.result-panel {
  margin-top: 8px;
}

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

.result-meta {
  display: flex;
  gap: 18px;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.result-meta strong {
  color: var(--color-primary);
  font-weight: 700;
}

.export-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.export-actions .btn {
  padding: 8px 14px;
  font-size: 14px;
}

/* 结果容器（ruby 标注）：干净的“纸张”感 */
.py-result {
  --py-color: #e0393e;
  --py-font-size: 15px;
  --py-font-family: "Nunito", Arial, sans-serif;
  --han-font-size: 24px;

  padding: 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  min-height: 140px;
  font-size: var(--han-font-size);
  line-height: 2.2;
  color: var(--color-text);
  word-break: break-all;
  overflow-wrap: break-word;
}

.py-item {
  margin: 0 0.06em;
}

.py-item rt {
  font-size: var(--py-font-size);
  color: var(--py-color);
  font-family: var(--py-font-family);
  line-height: 1.4;
}

/* 多音字可编辑样式 */
.py-poly {
  cursor: pointer;
  border-radius: 3px;
  position: relative;
}

.py-poly:hover {
  background: rgba(37, 99, 235, 0.10);
}

.py-poly rt {
  border-bottom: 1px dashed rgba(37, 99, 235, 0.65);
}

/* 多音字读音选择器 */
.py-picker {
  position: absolute;
  z-index: 200;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
  padding: 10px;
  width: 150px;
}

.py-picker-title {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: 8px;
}

.py-picker-item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 4px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #fffaf4;
  font-size: 15px;
  color: var(--color-text);
  cursor: pointer;
  text-align: center;
  font-family: inherit;
}

.py-picker-item:hover {
  background: var(--color-primary-soft);
  border-color: var(--color-border);
}

.py-picker-item.active {
  background: var(--color-primary);
  color: #fff;
}

/* 空状态提示 */
.empty-hint {
  padding: 40px;
  text-align: center;
  color: var(--color-text-secondary);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  background: #fffaf4;
}

/* SEO 内容区 */
.seo-content {
  margin-top: 32px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.seo-content h2 {
  font-size: 22px;
  margin-bottom: 14px;
}

.seo-content h3 {
  font-size: 18px;
  margin: 22px 0 10px;
}

.seo-content p,
.seo-content li {
  color: var(--color-text-secondary);
  font-size: 15px;
  line-height: 1.8;
}

.seo-content ul,
.seo-content ol {
  padding-left: 22px;
  margin-bottom: 12px;
}

.seo-content section {
  margin-bottom: 20px;
}

/* 移动端适配 */
@media (max-width: 600px) {
  .tool-card {
    padding: 16px;
  }

  .page-hero h1 {
    font-size: 25px;
  }

  .options {
    flex-direction: column;
    align-items: flex-start;
  }

  .py-result {
    padding: 16px;
  }
}
