/* studio 官网样式：简约、现代的公司站观感。
   只对 jiurui.studio 生效 —— 本文件由 studio/base_studio.html 引入，
   博客站（zhuxiaobin.cn）不会加载它，两边互不干扰。
   改过本文件就把 base_studio.html 里的 ?v=N 加 1，否则浏览器一直用旧缓存。
   不引任何第三方资源：字体走系统栈、图标走内联 SVG，符合 default-src 'self'。 */

:root {
    --st-accent: #640000; /* 绛红主色，与博客 --accent 同值 */
    --st-accent-soft: #F0E6E6;
    --st-btn-hover: #741A1A;   /* p600，PPT 标注的 Hover 态 */
    --st-ink: #2E2A28;
    --st-muted: #666666;
    --st-line: #DED5CD;
    --st-bg-soft: #FDFBF9;
    --st-radius: 12px;
}

/* 官网版式比博客宽一点：卡片两栏、三栏才排得开 */
body[class*="template-studio"] .wrap {
    max-width: 1120px;
}

/* ---------- 页头：公司站观感 ---------- */

body[class*="template-studio"] .site-header {
    padding: 24px 0;
}

body[class*="template-studio"] .site-name {
    font-size: 20px;
    letter-spacing: -0.01em;
}

/* 官网导航靠右（博客保持站点名后紧跟导航的排法，不动它） */
body[class*="template-studio"] .site-header nav {
    margin-left: auto;
}

@media (max-width: 640px) {
    body[class*="template-studio"] .site-header nav {
        margin-left: 0;
    }
}

/* ---------- Hero：首页第一屏 ---------- */

.studio-hero {
    padding: 56px 0 40px;
    border-bottom: 1px solid var(--st-line);
}

.studio-hero h1 {
    margin: 0 0 12px;
    font-size: 40px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--st-ink);
}

.studio-hero .studio-intro {
    margin: 0 0 24px;
    max-width: 640px;
    font-size: 18px;
    line-height: 1.7;
    color: var(--st-muted);
}

.studio-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.studio-btn {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid var(--st-accent);
    border-radius: 8px;
    background: var(--st-accent);
    color: #fff;
    font-size: 15px;
    font-weight: 500;
}

.studio-btn:hover {
    text-decoration: none;
    background: var(--st-btn-hover);
    border-color: var(--st-btn-hover);
}

.studio-btn.is-ghost {
    background: #fff;
    color: var(--st-accent);
}

.studio-btn.is-ghost:hover {
    background: var(--st-accent-soft);
}

/* ---------- 区块 ---------- */

.studio-section {
    padding: 40px 0;
    border-bottom: 1px solid var(--st-line);
}

.studio-section:last-of-type {
    border-bottom: 0;
}

.studio-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.studio-section-head h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 650;
    color: var(--st-ink);
}

.studio-more {
    font-size: 14px;
}

/* ---------- 卡片 ---------- */

.studio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.studio-card {
    border: 1px solid var(--st-line);
    border-radius: var(--st-radius);
    background: #fff;
    padding: 20px;
    transition:
        box-shadow 0.15s ease,
        transform 0.15s ease,
        border-color 0.15s ease;
}

.studio-card:hover {
    border-color: var(--p200);
    box-shadow: 0 8px 24px rgba(46, 42, 40, 0.09);
    transform: translateY(-2px);
}

.studio-card > a {
    display: block;
    color: inherit;
}

.studio-card > a:hover {
    text-decoration: none;
}

.studio-card h2,
.studio-card h3 {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 600;
    color: var(--st-ink);
}

.studio-card p {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: var(--st-muted);
}

.studio-thumb {
    display: block;
    width: 100%;
    height: 150px;
    margin-bottom: 14px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--st-bg-soft);
}

/* ---------- 视图切换：卡片 / 列表 ---------- */

.studio-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 24px 0 16px;
}

.studio-count {
    font-size: 14px;
    color: var(--st-muted);
}

.view-switch {
    display: inline-flex;
    overflow: hidden;
    border: 1px solid var(--st-line);
    border-radius: 8px;
    background: #fff;
}

.view-switch button {
    border: 0;
    background: #fff;
    padding: 7px 14px;
    color: var(--st-muted);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
}

.view-switch button + button {
    border-left: 1px solid var(--st-line);
}

.view-switch button[aria-pressed="true"] {
    background: var(--st-accent);
    color: #fff;
}

/* 没 JS 时 data-view 停在 card，卡片视图照常可用 */
.studio-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.studio-items[data-view="list"] {
    grid-template-columns: 1fr;
    gap: 12px;
}

/* 列表模式：整块不上浮，只保留边框与阴影的轻微反馈 */
.studio-items[data-view="list"] .studio-card:hover {
    transform: none;
}

/* grid 要加在 <a> 上，不是 li：
   卡片里 <a> 是 li 唯一的子元素（图 / 标题 / 摘要都在它里面），加在 li 上会让整块内容
   被塞进第一列那 96px 里。 */
.studio-items[data-view="list"] .studio-card > a {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 4px 16px;
    align-items: center;
}

.studio-items[data-view="list"] .studio-thumb {
    grid-row: 1 / span 2; /* 缩略图竖跨标题与摘要两行 */
    width: 96px;
    height: 64px;
    margin: 0;
}

.studio-items[data-view="list"] .studio-card h2,
.studio-items[data-view="list"] .studio-card h3,
.studio-items[data-view="list"] .studio-card p {
    grid-column: 2;
    margin: 0;
}

/* 没配图的条目：标题/摘要回到第一列并占满整行 */
.studio-items[data-view="list"] .studio-card h2:first-child,
.studio-items[data-view="list"] .studio-card h3:first-child,
.studio-items[data-view="list"] .studio-card h2:first-child ~ p,
.studio-items[data-view="list"] .studio-card h3:first-child ~ p {
    grid-column: 1 / -1;
}

/* ---------- 简约列表（新闻等） ---------- */

.studio-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.studio-list li {
    padding: 14px 0;
    border-bottom: 1px dashed var(--st-line);
}

.studio-list li:last-child {
    border-bottom: 0;
}

.studio-list a {
    color: var(--st-ink);
    font-size: 16px;
}

.studio-list .studio-date {
    margin-left: 8px;
    font-size: 13px;
    color: var(--st-muted);
}

.studio-list p {
    margin: 4px 0 0;
    font-size: 14px;
    line-height: 1.7;
    color: var(--st-muted);
}

/* ---------- 详情页 ---------- */

.studio-detail-head {
    padding: 16px 0 8px;
}

.studio-detail-head h1 {
    margin: 0 0 8px;
    font-size: 30px;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--st-ink);
}

.studio-back {
    font-size: 14px;
}

/* ---------- 联系信息 ---------- */

.studio-contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.studio-info-card {
    border: 1px solid var(--st-line);
    border-radius: var(--st-radius);
    background: var(--st-bg-soft);
    padding: 18px;
}

.studio-info-card dt {
    font-size: 13px;
    color: var(--st-muted);
}

.studio-info-card dd {
    margin: 4px 0 0;
    font-size: 16px;
    color: var(--st-ink);
}

/* ---------- 空状态 ---------- */

.studio-empty {
    padding: 32px 0;
    color: var(--st-muted);
}

/* 空状态要占满整行，否则会被挤在网格第一列 */
.studio-items .studio-empty,
.studio-grid .studio-empty {
    grid-column: 1 / -1;
}

/* ---------- 窄屏 ---------- */

@media (max-width: 640px) {
    .studio-hero {
        padding: 36px 0 28px;
    }

    .studio-hero h1 {
        font-size: 30px;
    }

    .studio-hero .studio-intro {
        font-size: 16px;
    }

    .studio-items,
    .studio-grid {
        grid-template-columns: 1fr;
    }

    .studio-items[data-view="list"] .studio-card > a {
        grid-template-columns: 64px 1fr;
    }

    .studio-items[data-view="list"] .studio-thumb {
        width: 64px;
        height: 48px;
    }
}

/* ---------- 官网正文排版（字号 / 行高 / 间距）----------
   颜色与字体族不在这里，统一放在 jiurui.css 的「正文配色」块，两站共用一份。
   这里只放官网自己的尺寸节奏：官网正文 16px/1.9，博客正文 17px/1.8，
   两边读感不同，所以排版各站自己管，不要往一起并。
   改色值改 jiurui.css，改字号改这里。 */

body[class*="template-studio"] .body h1 {
    font-size: 28px;
    font-weight: 600;
    line-height: 1.5;
    margin: 30px 0 16px;
}

body[class*="template-studio"] .body h2 {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.5;
    margin: 34px 0 14px;
}

body[class*="template-studio"] .body h3 {
    font-size: 17px;
    font-weight: 600;
    margin: 26px 0 12px;
}

body[class*="template-studio"] .body h4,
body[class*="template-studio"] .body h5,
body[class*="template-studio"] .body h6 {
    font-size: 15px;
    font-weight: 600;
    margin: 22px 0 10px;
}

body[class*="template-studio"] .body p {
    font-size: 16px;
    line-height: 1.9;
}

body[class*="template-studio"] .body ul,
body[class*="template-studio"] .body ol {
    font-size: 16px;
    line-height: 1.9;
}

body[class*="template-studio"] .body li {
    margin: 0 0 6px;
}

body[class*="template-studio"] .body code {
    font-size: 0.92em;
}

body[class*="template-studio"] .body blockquote {
    margin: 0 0 20px;
    padding: 14px 18px;
    font-size: 15.5px;
}

body[class*="template-studio"] .body hr {
    margin: 28px 0;
}
