/* TheStoneDB 前台样式 */
/* 与父主题 stoat 设计变量保持一致（--gray / --dark-gray 等由父主题提供）。 */

/* ---------- Material Hero ---------- */
.stonedb-hero {
    margin: 1.5em 0 2em;
}

.stonedb-hero__media {
    margin-bottom: 1.25em;
}

.stonedb-hero__img,
.stonedb-main-image__img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
}

.stonedb-hero__title {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    line-height: 1.2;
    margin: 0 0 0.3em;
}

.stonedb-hero__subtitle {
    color: var(--gray, #6b7280);
    font-size: 1.05em;
    margin: 0 0 1em;
}

/* ---------- 分类术语徽章 ---------- */
.stone-db-terms {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    margin: 0.4em 0;
}

.stone-db-badge-label {
    font-size: 0.9em;
    color: var(--gray, #6b7280);
    margin-right: 2px;
}

.stone-db-badge {
    display: inline-block;
    border: 1px solid #e2e5e9;
    border-radius: 999px;
    padding: 3px 12px;
    font-size: 0.82em;
    color: var(--dark-gray, #374151);
    background: #fff;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.stone-db-badge:hover {
    background: rgba(0, 0, 0, 0.03);
    border-color: #c9cdd4;
    text-decoration: none;
}

/* ---------- Section ---------- */
.stone-db-section,
.stonedb-section {
    margin: 2.5em 0;
}

.stone-db-section__title,
.stonedb-section__title {
    font-size: 1.35rem;
    margin: 0 0 1em;
    padding-bottom: 0.4em;
    border-bottom: 1px solid #eef0f2;
}

/* 模块上方 H2 标题（参考站 thestonedb.com 风格） */
.stonedb-h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #334155;
    margin: 1.75em 0 0.85em;
    line-height: 1.3;
}

/* ---------- 卡片网格 ---------- */
.stone-db-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

.stone-db-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #eef0f2;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.stone-db-card:hover {
    border-color: #d5d9de;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

.stone-db-card__media {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f4f5f6;
}

.stone-db-card__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.stone-db-card:hover .stone-db-card__img {
    transform: scale(1.03);
}

.stone-db-card__body {
    padding: 14px 16px 16px;
}

.stone-db-card__title {
    font-size: 1.02rem;
    margin: 0 0 0.35em;
    line-height: 1.3;
}

.stone-db-card__title a {
    color: inherit;
    text-decoration: none;
}

.stone-db-card__title a:hover {
    text-decoration: underline;
}

.stone-db-card__subtitle {
    font-size: 0.88em;
    color: var(--gray, #6b7280);
    margin-bottom: 0.5em;
}

/* ---------- 锁定卡 ---------- */
.stone-db-card--locked {
    align-items: center;
    justify-content: center;
    min-height: 200px;
    border-style: dashed;
    background: #fafafa;
}

.stone-db-card__lock {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    padding: 20px;
    color: var(--gray, #6b7280);
}

.stone-db-card__lock-icon {
    font-size: 2rem;
    line-height: 1;
}

.stone-db-card__lock-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stone-db-card__lock-text strong {
    color: var(--dark-gray, #374151);
}

/* ---------- 画廊 ---------- */
.stonedb-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.stonedb-gallery__item {
    margin: 0;
}

.stonedb-gallery__img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
}

/* ---------- 字段列表 ---------- */
.stonedb-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px 24px;
    margin: 0;
}

.stone-db-field {
    margin: 0;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f5;
}

.stone-db-field__label {
    font-size: 0.78em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--gray, #6b7280);
    margin-bottom: 2px;
}

.stone-db-field__value {
    margin: 0;
    font-size: 0.95em;
}

/* ---------- 图片元数据 ---------- */
.stone-db-img-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin-top: 6px;
    font-size: 0.8em;
    color: var(--gray, #6b7280);
}

/* ---------- 描述块 ---------- */
.stonedb-description {
    margin: 1.5em 0;
}

/* ---------- Comparison ---------- */
.stonedb-vs {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 1.5em 0;
    flex-wrap: wrap;
}

.stonedb-vs__item {
    display: inline-block;
    border: 1px solid #e2e5e9;
    border-radius: 999px;
    padding: 8px 20px;
    color: var(--dark-gray, #374151);
    text-decoration: none;
    font-weight: 600;
}

.stonedb-vs__item:hover {
    background: rgba(0, 0, 0, 0.03);
    text-decoration: none;
}

.stonedb-vs__sep {
    font-size: 0.9em;
    color: var(--gray, #6b7280);
}

.stonedb-summary {
    margin: 1.5em 0;
    padding: 16px 18px;
    background: #fafafa;
    border-left: 3px solid #e2e5e9;
    border-radius: 8px;
    color: var(--dark-gray, #374151);
}

/* ---------- 受限内容 ---------- */
.stonedb-restricted {
    max-width: 640px;
    margin: 3em auto;
}

.stonedb-restricted__box {
    border: 1px dashed #d5d9de;
    border-radius: 12px;
    padding: 40px 28px;
    text-align: center;
    background: #fafafa;
}

.stonedb-restricted__title {
    margin: 0 0 0.5em;
}

.stonedb-restricted__text {
    color: var(--gray, #6b7280);
    margin: 0 0 1.25em;
}

.stonedb-restricted__cta {
    display: inline-block;
    border-radius: 999px;
    padding: 10px 28px;
    background: var(--dark-gray, #374151);
    color: #fff;
    text-decoration: none;
}

.stonedb-restricted__cta:hover {
    background: #000;
    color: #fff;
    text-decoration: none;
}

/* ---------- 响应式 ---------- */
@media (max-width: 600px) {
    .stone-db-grid {
        grid-template-columns: 1fr;
    }

    .stonedb-gallery {
        grid-template-columns: 1fr;
    }
}

/* ---------- 石材简介 ---------- */
.stonedb-intro {
    margin: 1.25em 0 1.5em;
    color: var(--dark-gray, #374151);
    font-size: 1.02em;
}

/* ---------- 石材物理信息卡片（与五维评级 / 检测报告 .stn-* 样式统一） ---------- */
.stonedb-physical {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 24px auto;
    padding: 20px 24px;
    background: var(--stn-bg, #ffffff);
    border-radius: var(--stn-radius, 12px);
    border: 1px solid #e2e5e9;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC",
        "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC",
        "WenQuanYi Micro Hei", sans-serif;
}

.stonedb-physical .stonedb-section__title {
    font-size: calc(var(--stn-font, 14px) + 4px);
    font-weight: 700;
    color: #334155;
    margin-bottom: 14px;
    padding-bottom: 0;
    border-bottom: 0;
}

/* 表格形式（与检测报告 .stn-test 表格风格一致） */
.stonedb-physical__table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.stonedb-physical__table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--stn-font, 14px);
    min-width: 480px;
}

.stonedb-physical__table thead th {
    text-align: left;
    padding: 10px 12px;
    font-size: calc(var(--stn-font, 14px) - 1px);
    font-weight: 600;
    color: #64748b;
    border-bottom: 1px solid #eef1f5;
    white-space: nowrap;
}

.stonedb-physical__table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid #eef1f5;
    vertical-align: top;
    color: #1e293b;
}

.stonedb-physical__table tbody tr:last-child td {
    border-bottom: 0;
}

.stonedb-physical__name {
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
    width: 30%;
}

.stonedb-physical__value .stone-db-terms {
    margin: 0;
}

.stonedb-physical__value .stone-db-badge {
    font-size: 12px;
    color: #475569;
    background: #fff;
}

@media (prefers-color-scheme: dark) {
    .stonedb-physical {
        background: #1e293b;
        border-color: #334155;
    }
    .stonedb-physical .stonedb-section__title {
        color: #e2e8f0;
    }
    .stonedb-physical__table thead th {
        color: #94a3b8;
        border-bottom-color: #334155;
    }
    .stonedb-physical__table tbody td {
        color: #e2e8f0;
        border-bottom-color: #334155;
    }
    .stonedb-physical__name {
        color: #cbd5e1;
    }
    .stonedb-physical__value .stone-db-badge {
        color: #cbd5e1;
        background: #1e293b;
        border-color: #334155;
    }
}

/* ---------- 锁定行（整行提示） ---------- */
.stone-db-locked-row {
    margin: 1.5em 0 0;
}

.stone-db-locked-row .stone-db-card--locked {
    min-height: 96px;
}

.stone-db-locked-row .stone-db-card__lock {
    flex-direction: row;
    gap: 14px;
    text-align: left;
    padding: 18px 24px;
}

.stone-db-locked-row .stone-db-card__lock-icon {
    font-size: 1.6rem;
}
