/* ============================================
   文玩核桃网站 - 鉴赏鉴别页面专用样式
   ============================================ */

/* 鉴赏板块入口 */
.appraisal-hero {
  text-align: center;
  padding: var(--space-3xl) 0 var(--space-xl);
  background: linear-gradient(135deg, rgba(183,28,28,0.05), transparent, rgba(201,169,110,0.08));
  border-bottom: 3px solid var(--color-primary);
}

.appraisal-hero__title {
  font-family: var(--font-title);
  font-size: 2.2rem;
  color: var(--color-ink);
  margin-bottom: var(--space-md);
}

.appraisal-hero__desc {
  font-size: 1rem;
  color: var(--color-text-light);
  max-width: 500px;
  margin: 0 auto var(--space-xl);
}

/* 验证区域 */
.auth-section {
  max-width: 400px;
  margin: 0 auto;
  padding: var(--space-xl);
  background: var(--color-white);
  border: 2px solid var(--color-gold-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.auth-section__title {
  font-family: var(--font-title);
  font-size: 1.2rem;
  text-align: center;
  margin-bottom: var(--space-lg);
  color: var(--color-ink);
}

.auth-section__input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 1rem;
  text-align: center;
  letter-spacing: 4px;
  outline: none;
  transition: border-color var(--transition-fast);
  margin-bottom: var(--space-md);
}

.auth-section__input:focus {
  border-color: var(--color-primary);
}

.auth-section__error {
  color: var(--color-primary);
  font-size: 0.85rem;
  text-align: center;
  margin-bottom: var(--space-sm);
  min-height: 1.4em;
}

.auth-section__hint {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-align: center;
  margin-top: var(--space-md);
}

/* 对照式鉴定工具 */
.identifier-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin: var(--space-xl) 0;
}

.identifier-panel {
  background: var(--color-white);
  border: 1px solid var(--color-gold-light);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}

.identifier-panel__title {
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: var(--color-ink);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--color-gold-light);
}

.identifier-panel__upload {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: var(--space-md);
}

.identifier-panel__upload:hover {
  border-color: var(--color-primary);
  background: rgba(183, 28, 28, 0.02);
}

.identifier-panel__upload-icon {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
}

.identifier-panel__upload-text {
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.identifier-result {
  text-align: center;
}

.identifier-result__match {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
}

.identifier-result__confidence {
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin-bottom: var(--space-md);
}

/* 鉴别对比表 */
.comparison-table {
  margin: var(--space-xl) 0;
}

.comparison-row {
  display: grid;
  grid-template-columns: 120px 1fr 1fr;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.9rem;
}

.comparison-row:last-child {
  border-bottom: none;
}

.comparison-row__label {
  font-weight: 600;
  color: var(--color-ink);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-paper-dark);
}

.comparison-row__value {
  padding: var(--space-sm) var(--space-md);
}

/* 瑕疵检查清单 */
.flaw-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}

.flaw-check-item {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
}

.flaw-check-item__icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.flaw-check-item__content {
  min-width: 0;
}

.flaw-check-item__name {
  font-weight: 600;
  color: var(--color-ink);
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.flaw-check-item__desc {
  font-size: 0.8rem;
  color: var(--color-text-light);
  line-height: 1.5;
}

/* ============================================
   品种卡片与配图样式（参考knowledge.css）
   ============================================ */

/* 品种展示卡片 - 图文并排 */
.variety-card {
  display: flex;
  gap: 20px;
  padding: 20px;
  margin-bottom: 24px;
  background: #faf8f5;
  border: 1px solid #d4c5a9;
  border-radius: 8px;
  transition: box-shadow 0.3s, transform 0.3s;
}

.variety-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.variety-card__image {
  flex-shrink: 0;
  width: 180px;
  height: 180px;
  overflow: hidden;
  border-radius: 4px;
  background: #f0ebe3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.variety-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.variety-card__info {
  flex: 1;
  min-width: 0;
}

.variety-card__info h4 {
  color: #b71c1c;
  margin-bottom: 8px;
  font-size: 18px;
  margin-top: 0;
}

.variety-card__info p {
  margin-bottom: 0.5em;
  line-height: 1.8;
}

.variety-card__info ul {
  padding-left: 1.5em;
  margin-bottom: 0;
}

.variety-card__info li {
  margin-bottom: 4px;
  line-height: 1.7;
}

/* 品种配图 - 居中展示 */
.variety-figure {
  text-align: center;
  margin: 16px 0;
}

.variety-figure img {
  max-width: 300px;
  border-radius: 8px;
  border: 1px solid #d4c5a9;
}

.variety-figure figcaption,
.variety-figure p {
  font-size: 13px;
  color: #666;
  margin-top: 6px;
}

/* 品种网格 - 用于品种对比展示 */
.variety-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin: 1em 0;
}

.variety-grid .variety-card {
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px;
  margin-bottom: 0;
}

.variety-grid .variety-card__image {
  width: 100%;
  max-width: 220px;
  height: auto;
  aspect-ratio: 1;
}

/* ============================================
   鉴赏页面专用图片展示样式
   ============================================ */

/* 对比图卡片 */
.compare-card {
  background: var(--color-white);
  border: 1px solid var(--color-gold-light);
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.3s, transform 0.3s;
  text-align: center;
}

.compare-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.compare-card img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}

.compare-card__label {
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.9rem;
}

.compare-card__desc {
  padding: 0 16px 12px;
  font-size: 0.85rem;
  color: var(--color-text-light);
}

/* 鉴定特征图示 */
.feature-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.feature-showcase__item {
  background: var(--color-white);
  border: 1px solid var(--color-gold-light);
  border-radius: 8px;
  overflow: hidden;
  text-align: center;
  transition: box-shadow 0.3s;
}

.feature-showcase__item:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.feature-showcase__item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.feature-showcase__item .label {
  padding: 8px 12px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-ink);
}

.feature-showcase__item .desc {
  padding: 0 12px 10px;
  font-size: 0.8rem;
  color: var(--color-text-light);
}

/* 瑕疵卡片样式 */
.flaw-card {
  background: var(--color-white);
  border: 1px solid var(--color-gold-light);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
  transition: box-shadow 0.3s;
}

.flaw-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.flaw-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(183,28,28,0.04), rgba(201,169,110,0.06));
  border-bottom: 1px solid var(--color-gold-light);
}

.flaw-card__icon {
  font-size: 1.5rem;
}

.flaw-card__title {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-ink);
}

.flaw-card__severity {
  margin-left: auto;
  font-size: 0.75rem;
  padding: 2px 10px;
  border-radius: 10px;
  font-weight: 600;
}

.flaw-card__severity--high {
  background: rgba(183,28,28,0.1);
  color: #b71c1c;
}

.flaw-card__severity--medium {
  background: rgba(230,126,34,0.1);
  color: #e67e22;
}

.flaw-card__severity--low {
  background: rgba(39,174,96,0.1);
  color: #27ae60;
}

.flaw-card__body {
  padding: 16px 20px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.flaw-card__image {
  flex-shrink: 0;
  width: 160px;
  height: 160px;
  border-radius: 6px;
  overflow: hidden;
  background: #f0ebe3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flaw-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.flaw-card__content {
  flex: 1;
  min-width: 0;
}

.flaw-card__content p {
  margin-bottom: 0.5em;
  line-height: 1.8;
  font-size: 0.9rem;
}

.flaw-card__content ul {
  padding-left: 1.5em;
  margin-bottom: 0;
}

.flaw-card__content li {
  margin-bottom: 4px;
  line-height: 1.7;
  font-size: 0.9rem;
}

/* 鉴定工具特征参考图 */
.feature-ref {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.feature-ref__item {
  background: var(--color-white);
  border: 1px solid var(--color-gold-light);
  border-radius: 6px;
  overflow: hidden;
  text-align: center;
  font-size: 0.8rem;
}

.feature-ref__item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.feature-ref__item .name {
  padding: 6px 8px;
  font-weight: 600;
  color: var(--color-ink);
}

/* 鉴赏入口卡片网格 */
.appraisal-nav-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 32px;
}

.appraisal-nav-card {
  display: block;
  text-decoration: none;
  background: var(--color-white);
  border: 1px solid var(--color-gold-light);
  border-radius: 10px;
  padding: 28px 20px;
  text-align: center;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.appraisal-nav-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-gold));
  opacity: 0;
  transition: opacity 0.3s;
}

.appraisal-nav-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  transform: translateY(-3px);
  border-color: var(--color-gold);
}

.appraisal-nav-card:hover::before {
  opacity: 1;
}

.appraisal-nav-card__icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: block;
}

.appraisal-nav-card__title {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-ink);
  margin-bottom: 6px;
}

.appraisal-nav-card__desc {
  font-size: 0.85rem;
  color: var(--color-text-light);
}

/* 案例卡片增强 */
.case-header {
  background: linear-gradient(135deg, rgba(183,28,28,0.04), rgba(201,169,110,0.06));
  border: 1px solid var(--color-gold-light);
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0 16px;
}

.case-header__label {
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.case-header__text {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--color-text);
}

/* 鉴定步骤流程 */
.identify-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
  align-items: center;
}

.identify-steps__step {
  background: var(--color-white);
  border: 1px solid var(--color-gold-light);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-ink);
}

.identify-steps__arrow {
  color: var(--color-gold);
  font-size: 1rem;
}

/* ============================================
   排版优化（参考knowledge.css）
   ============================================ */

.knowledge-article h2 {
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
}

.knowledge-article h3 {
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
}

.knowledge-article h4 {
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

.knowledge-article p {
  margin-bottom: var(--space-md);
  line-height: 1.9;
}

.knowledge-article ul,
.knowledge-article ol {
  margin-bottom: var(--space-md);
}

.knowledge-article li {
  margin-bottom: 6px;
  line-height: 1.8;
}

.knowledge-article blockquote {
  margin: var(--space-lg) 0;
}

/* 表格间距优化 */
.knowledge-article .data-table {
  margin: var(--space-md) 0;
}

/* ============================================
   响应式调整
   ============================================ */

@media (max-width: 768px) {
  .appraisal-hero__title { font-size: 1.6rem; }
  .identifier-layout { grid-template-columns: 1fr; }
  .comparison-row {
    grid-template-columns: 80px 1fr 1fr;
    font-size: 0.8rem;
  }
  .flaw-checklist {
    grid-template-columns: 1fr;
  }
  .variety-card {
    flex-direction: column;
  }
  .variety-card__image {
    width: 100%;
    max-width: 220px;
    height: auto;
    aspect-ratio: 1;
    margin: 0 auto;
  }
  .variety-grid {
    grid-template-columns: 1fr;
  }
  .appraisal-nav-grid {
    grid-template-columns: 1fr;
  }
  .flaw-card__body {
    flex-direction: column;
  }
  .flaw-card__image {
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
  }
  .feature-showcase {
    grid-template-columns: repeat(2, 1fr);
  }
  .feature-ref {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================
   品种图片统一尺寸与点击放大样式
   ============================================ */

/* 品种展示图片统一显示尺寸 480×320 */
.variety-card__image img,
.variety-figure img,
.variety-grid .variety-card__image img,
.flaw-card__image img,
.feature-showcase__item img,
.feature-ref__item img,
.compare-card img {
  max-width: 480px;
  width: 100%;
  height: auto;
  cursor: pointer;
  border-radius: 8px;
  transition: transform 0.2s;
}

.variety-card__image img:hover,
.variety-figure img:hover,
.variety-grid .variety-card__image img:hover,
.flaw-card__image img:hover,
.feature-showcase__item img:hover,
.feature-ref__item img:hover,
.compare-card img:hover {
  transform: scale(1.02);
}

/* variety-card__image 容器适配 */
.variety-card__image {
  width: auto;
  max-width: 480px;
  height: auto;
  aspect-ratio: auto;
}

/* flaw-card__image 容器适配 */
.flaw-card__image {
  width: auto;
  max-width: 480px;
  height: auto;
  aspect-ratio: auto;
}

/* feature-showcase__item 容器适配 */
.feature-showcase__item img {
  aspect-ratio: auto;
}

/* feature-ref__item 容器适配 */
.feature-ref__item img {
  aspect-ratio: auto;
}

/* ============================================
   灯箱（Lightbox）样式
   ============================================ */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox-overlay--active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  position: relative;
  max-width: 800px;
  max-height: 600px;
  width: 90vw;
  height: auto;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.lightbox-overlay--active .lightbox-content {
  transform: scale(1);
}

.lightbox-content img {
  width: 100%;
  max-width: 800px;
  max-height: 600px;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  line-height: 1;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-close::before {
  content: '✕';
}

/* 手机端灯箱适配 + 品种图片适配 */
@media (max-width: 768px) {
  .variety-card__image {
    width: 100%;
    max-width: 480px;
    height: auto;
  }
  .variety-card__image img {
    max-width: 100%;
  }
  .flaw-card__image {
    width: 100%;
    max-width: 480px;
    height: auto;
  }
  .flaw-card__image img {
    max-width: 100%;
  }
  .lightbox-content {
    max-width: 95vw;
  }
  .lightbox-content img {
    max-width: 95vw;
    max-height: 70vh;
  }
  .lightbox-close {
    top: -44px;
    right: -4px;
    width: 40px;
    height: 40px;
    font-size: 22px;
  }
}
