/* ===========================================================================
   tpl002 重排版样式 —— 设计主题：暖纸杂志 (Warm Paper Magazine)
   浅暖米底 + 深棕通栏顶/底 + 焦橙点缀 + 16:9 横版卡片 + 衬线标题 + 大留白

   约定：
   - 本文件在 app.css 之后加载，只负责新版式；不修改、不依赖旧 CSS。
   - 所有类名统一 t2- 前缀，与旧主题类名（Tailwind 原子类 / thumbnail / play-* …）
     完全隔离，避免旧样式表里的规则意外命中新结构。
   - 播放器由程序输出、磁力按钮沿用旧 down_btn 钩子，故 app.css 必须保留引用。
   - 顶栏/导航/搜索全部为纯 CSS + 原生表单，不依赖任何 JS（旧 app.js 已失效，见说明）。
   =========================================================================== */

.t2-scope,
.t2-scope * { box-sizing: border-box; }

:root {
    --t2-bg: #faf6f0;
    --t2-surface: #ffffff;
    --t2-surface-2: #f3ece2;
    --t2-ink: #2a211c;
    --t2-ink-soft: #5b4e45;
    --t2-muted: #948578;
    --t2-line: #e6dacb;
    --t2-accent: #e2622a;
    --t2-accent-dark: #b4471c;
    --t2-dark: #2b211d;
    --t2-dark-2: #3a2d27;
    --t2-radius: 12px;
    --t2-shadow: 0 6px 18px rgba(72, 47, 30, .10);
    --t2-shadow-hover: 0 14px 30px rgba(72, 47, 30, .18);
    --t2-max: 1280px;
    --t2-serif: Georgia, "Times New Roman", "Songti SC", "SimSun", serif;
}

/* --------------------------------------------------------------- 基础层 */
body.t2-body {
    margin: 0;
    background: var(--t2-bg);
    color: var(--t2-ink);
    font: 400 14px/1.7 "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* 纸纹：极淡的斜向条纹，固定在视口，不参与布局也不拦截点击 */
body.t2-body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: .5;
    background-image: repeating-linear-gradient(135deg,
        rgba(180, 71, 28, .035) 0, rgba(180, 71, 28, .035) 1px,
        transparent 1px, transparent 9px);
}

.t2-scope {
    position: relative;
    z-index: 1;
}

.t2-scope-top { z-index: 900; }

.t2-wrap {
    max-width: var(--t2-max);
    margin: 0 auto;
    padding: 0 18px;
}

.t2-scope a { color: inherit; text-decoration: none; }
.t2-scope img { display: block; max-width: 100%; border: 0; }
.t2-scope ul, .t2-scope li { margin: 0; padding: 0; list-style: none; }
.t2-scope h1, .t2-scope h2, .t2-scope h3, .t2-scope p { margin: 0; font-weight: inherit; }

/* --------------------------------------------------------------- 顶栏 */
.t2-topbar {
    position: sticky;
    top: 0;
    z-index: 950;
    background: var(--t2-dark);
    color: #f6ece1;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .18);
}

.t2-topbar-in {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 62px;
    padding-top: 8px;
    padding-bottom: 8px;
    flex-wrap: wrap;
}

.t2-logo {
    font: 700 26px/1.2 var(--t2-serif);
    letter-spacing: .5px;
    white-space: nowrap;
}

/* logo_text 里带的是旧主题的原子类（浅底会看不见），这里按新配色纠正 */
.t2-logo .text-zinc-50 { color: #fdf7ef; }
.t2-logo .text-primary { color: var(--t2-accent); }

/* 搜索：原生表单直接提交 /search.php，无 JS 依赖 */
.t2-search {
    flex: 1 1 320px;
    display: flex;
    align-items: stretch;
    max-width: 560px;
    background: rgba(255, 255, 255, .09);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    overflow: hidden;
}

.t2-search-input {
    flex: 1;
    min-width: 0;
    padding: 9px 18px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fdf7ef;
    font-size: 14px;
}

.t2-search-input::placeholder { color: rgba(253, 247, 239, .5); }

.t2-search-btn {
    padding: 0 22px;
    border: 0;
    cursor: pointer;
    background: var(--t2-accent);
    color: #fff;
    font-size: 14px;
    letter-spacing: 2px;
    transition: background .18s;
}

.t2-search-btn:hover { background: var(--t2-accent-dark); }

/* 顶栏右侧的友情站点：横排，窄屏自动换行 */
.t2-toplinks {
    display: flex;
    align-items: center;
    gap: 6px 14px;
    flex-wrap: wrap;
    font-size: 13px;
    color: rgba(253, 247, 239, .62);
}

.t2-toplinks-label {
    color: rgba(253, 247, 239, .38);
    letter-spacing: 1px;
}

.t2-toplinks a:hover { color: var(--t2-accent); }

/* --------------------------------------------------------------- 导航 */
.t2-nav {
    background: var(--t2-dark-2);
    border-top: 1px solid rgba(255, 255, 255, .06);
}

.t2-nav-in {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.t2-nav-in::-webkit-scrollbar { display: none; }

.t2-nav-in a {
    flex: 0 0 auto;
    padding: 12px 14px;
    font-size: 14px;
    color: rgba(253, 247, 239, .78);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: color .18s, border-color .18s;
}

.t2-nav-in a:hover {
    color: #fff;
    border-bottom-color: var(--t2-accent);
}

.t2-nav-in a.t2-nav-home { color: var(--t2-accent); }

.t2-nav-sep {
    flex: 0 0 auto;
    width: 1px;
    height: 16px;
    margin: 0 8px;
    background: rgba(255, 255, 255, .14);
}

/* --------------------------------------------------------------- 广告位 */
/* 空广告位整块会被替换成空串，所以容器不设最小高度 */
.t2-ad-banner {
    margin: 16px 0;
}

.t2-ad-banner a {
    display: block;
    margin-bottom: 8px;
    border-radius: var(--t2-radius);
    overflow: hidden;
    box-shadow: var(--t2-shadow);
}

.t2-ad-banner img { width: 100%; object-fit: cover; }

.t2-ad-icons {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 14px;
    margin: 16px 0 4px;
}

.t2-ad-icons a {
    display: block;
    text-align: center;
    color: var(--t2-ink-soft);
}

.t2-ad-icons img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 16px;
    background: var(--t2-surface-2);
    box-shadow: var(--t2-shadow);
    transition: transform .2s, box-shadow .2s;
}

.t2-ad-icons a:hover img {
    transform: translateY(-3px);
    box-shadow: var(--t2-shadow-hover);
}

.t2-ad-icons p {
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --------------------------------------------------------------- 首页大标题区 */
.t2-hero {
    padding: 46px 0 30px;
    text-align: center;
}

.t2-hero h1 {
    font: 700 32px/1.3 var(--t2-serif);
    letter-spacing: 1px;
}

.t2-hero h1 em {
    font-style: normal;
    color: var(--t2-accent);
    border-bottom: 3px solid rgba(226, 98, 42, .35);
}

.t2-hero p {
    margin-top: 10px;
    color: var(--t2-muted);
    font-size: 13px;
    letter-spacing: 3px;
}

.t2-hero-search {
    display: flex;
    max-width: 620px;
    margin: 22px auto 0;
    background: var(--t2-surface);
    border: 1px solid var(--t2-line);
    border-radius: 999px;
    overflow: hidden;
    box-shadow: var(--t2-shadow);
}

.t2-hero-search input {
    flex: 1;
    min-width: 0;
    padding: 13px 22px;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 15px;
    color: var(--t2-ink);
}

.t2-hero-search button {
    padding: 0 30px;
    border: 0;
    cursor: pointer;
    background: var(--t2-accent);
    color: #fff;
    font-size: 15px;
    letter-spacing: 3px;
}

.t2-hero-search button:hover { background: var(--t2-accent-dark); }

/* --------------------------------------------------------------- 区块 */
.t2-section { margin: 34px 0; }

.t2-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 12px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--t2-line);
}

.t2-section-head h2 {
    position: relative;
    padding-left: 14px;
    font: 700 21px/1.3 var(--t2-serif);
}

.t2-section-head h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 4px;
    height: 20px;
    margin-top: -10px;
    background: var(--t2-accent);
    border-radius: 2px;
}

.t2-more {
    flex: 0 0 auto;
    font-size: 13px;
    color: var(--t2-muted);
    letter-spacing: 1px;
}

.t2-more:hover { color: var(--t2-accent); }

/* --------------------------------------------------------------- 16:9 卡片网格 */
.t2-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px 20px;
}

.t2-card {
    display: block;
    background: var(--t2-surface);
    border: 1px solid var(--t2-line);
    border-radius: var(--t2-radius);
    overflow: hidden;
    box-shadow: var(--t2-shadow);
    transition: transform .2s, box-shadow .2s, border-color .2s;
}

.t2-card:hover {
    transform: translateY(-4px);
    border-color: rgba(226, 98, 42, .45);
    box-shadow: var(--t2-shadow-hover);
}

.t2-card-pic {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--t2-surface-2);
    overflow: hidden;
}

.t2-card-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s;
}

.t2-card:hover .t2-card-pic img { transform: scale(1.05); }

.t2-card-body {
    display: block;
    padding: 10px 12px 12px;
}

.t2-card-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.9em;
    font-size: 13px;
    line-height: 1.45;
    color: var(--t2-ink-soft);
}

.t2-card:hover .t2-card-title { color: var(--t2-accent-dark); }

/* --------------------------------------------------------------- 详情页 */
.t2-detail {
    display: flex;
    align-items: flex-start;
    gap: 26px;
    margin: 24px 0 8px;
}

.t2-detail-main { flex: 1 1 auto; min-width: 0; }

.t2-detail-side {
    flex: 0 0 320px;
    width: 320px;
}

/* 播放器由程序注入，这里只做外框，不干预其内部结构与高度 */
.t2-player {
    width: 100%;
    background: #14100e;
    border-radius: var(--t2-radius);
    overflow: hidden;
    box-shadow: var(--t2-shadow-hover);
}

.t2-player video,
.t2-player iframe { display: block; width: 100%; border: 0; }

.t2-title {
    margin: 18px 0 4px;
    font: 700 20px/1.5 var(--t2-serif);
    word-break: break-all;
    overflow-wrap: break-word;
}

.t2-panel {
    margin: 18px 0;
    padding: 18px 20px;
    background: var(--t2-surface);
    border: 1px solid var(--t2-line);
    border-radius: var(--t2-radius);
    box-shadow: var(--t2-shadow);
}

.t2-meta {
    line-height: 2;
    color: var(--t2-ink-soft);
    word-break: break-all;
}

.t2-shots {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.t2-shots img {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--t2-line);
}

/* 磁力按钮：沿用旧的 down_btn 钩子，这里只做外观覆盖 */
.t2-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.t2-btns .down_btn {
    display: inline-block;
    padding: 11px 26px;
    border-radius: 999px;
    background: var(--t2-accent);
    color: #fff;
    font-size: 14px;
    letter-spacing: 1px;
    cursor: pointer;
    border: 1px solid var(--t2-accent);
    transition: background .18s, transform .18s;
}

.t2-btns .down_btn:hover {
    background: var(--t2-accent-dark);
    transform: translateY(-2px);
}

.t2-btns-ghost .down_btn {
    background: transparent;
    color: var(--t2-accent-dark);
}

.t2-btns-ghost .down_btn:hover {
    background: rgba(226, 98, 42, .10);
    color: var(--t2-accent-dark);
}

.t2-tip {
    margin-top: 14px;
    font-size: 13px;
    color: var(--t2-muted);
}

.t2-tip a { color: var(--t2-accent-dark); text-decoration: underline; }

/* 侧栏推荐：横向小卡 */
.t2-sidelist {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.t2-side-item {
    display: flex;
    gap: 12px;
    padding: 8px;
    background: var(--t2-surface);
    border: 1px solid var(--t2-line);
    border-radius: 10px;
    transition: border-color .18s, box-shadow .18s;
}

.t2-side-item:hover {
    border-color: rgba(226, 98, 42, .45);
    box-shadow: var(--t2-shadow);
}

.t2-side-pic {
    display: block;
    flex: 0 0 132px;
    width: 132px;
    aspect-ratio: 16 / 9;
    border-radius: 6px;
    overflow: hidden;
    background: var(--t2-surface-2);
}

.t2-side-pic img { width: 100%; height: 100%; object-fit: cover; }

.t2-side-title {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.45;
    color: var(--t2-ink-soft);
}

/* --------------------------------------------------------------- 列表页 */
.t2-listhead {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 26px 0 14px;
    border-bottom: 1px solid var(--t2-line);
    margin-bottom: 20px;
}

.t2-listhead h1 {
    position: relative;
    padding-left: 14px;
    font: 700 24px/1.3 var(--t2-serif);
}

.t2-listhead h1::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 4px;
    height: 22px;
    margin-top: -11px;
    background: var(--t2-accent);
    border-radius: 2px;
}

.t2-listhead span {
    flex: 0 0 auto;
    font-size: 13px;
    color: var(--t2-muted);
}

/* 分页 */
.t2-pager {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 30px 0 10px;
}

.t2-pager a,
.t2-pager .t2-page-cur {
    display: inline-block;
    min-width: 40px;
    padding: 8px 14px;
    text-align: center;
    font-size: 14px;
    border: 1px solid var(--t2-line);
    border-radius: 8px;
    background: var(--t2-surface);
    color: var(--t2-ink-soft);
    transition: all .18s;
}

.t2-pager a:hover {
    border-color: var(--t2-accent);
    color: var(--t2-accent-dark);
}

.t2-pager .t2-page-cur {
    background: var(--t2-accent);
    border-color: var(--t2-accent);
    color: #fff;
    cursor: default;
}

.t2-jump {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 8px 0 6px;
    font-size: 13px;
    color: var(--t2-muted);
}

.t2-jump input {
    width: 84px;
    padding: 7px 10px;
    border: 1px solid var(--t2-line);
    border-radius: 8px;
    background: var(--t2-surface);
    color: var(--t2-ink);
    outline: 0;
    text-align: center;
}

.t2-jump input:focus { border-color: var(--t2-accent); }

.t2-keytip {
    margin: 4px 0 26px;
    text-align: center;
    font-size: 12px;
    color: var(--t2-muted);
    letter-spacing: 1px;
}

/* --------------------------------------------------------------- 页脚 */
.t2-backtop {
    display: block;
    width: 44px;
    height: 44px;
    line-height: 42px;
    margin: 34px auto 0;
    text-align: center;
    font-size: 18px;
    border: 1px solid var(--t2-line);
    border-radius: 50%;
    background: var(--t2-surface);
    color: var(--t2-accent-dark);
    box-shadow: var(--t2-shadow);
}

.t2-backtop:hover {
    background: var(--t2-accent);
    color: #fff;
    border-color: var(--t2-accent);
}

.t2-footer {
    margin-top: 34px;
    padding: 40px 0 30px;
    background: var(--t2-dark);
    color: rgba(253, 247, 239, .72);
}

.t2-footer-in {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: 30px;
}

.t2-footer-brand .t2-logo {
    display: inline-block;
    margin-bottom: 12px;
}

.t2-footer-brand p {
    font-size: 12px;
    line-height: 1.9;
    color: rgba(253, 247, 239, .45);
}

.t2-footer h3 {
    margin-bottom: 12px;
    font-size: 13px;
    letter-spacing: 2px;
    color: #fdf7ef;
}

.t2-footer li { margin-bottom: 8px; font-size: 13px; }

.t2-footer li a:hover { color: var(--t2-accent); }

.t2-copy {
    max-width: var(--t2-max);
    margin: 26px auto 0;
    padding: 18px 18px 0;
    border-top: 1px solid rgba(255, 255, 255, .10);
    text-align: center;
    font-size: 12px;
    color: rgba(253, 247, 239, .40);
}

/* --------------------------------------------------------------- 响应式 */
/* 平板 */
@media (max-width: 1100px) {
    .t2-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .t2-ad-icons { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .t2-detail-side { display: none; }
    .t2-footer-in { grid-template-columns: 1fr 1fr; }
}

/* 手机 */
@media (max-width: 700px) {
    .t2-wrap { padding: 0 12px; }
    .t2-topbar-in { min-height: 54px; gap: 10px; }
    .t2-logo { font-size: 21px; }
    .t2-search { flex: 1 1 100%; order: 3; max-width: none; }
    .t2-toplinks { display: none; }
    .t2-nav-in a { padding: 10px 11px; font-size: 13px; }
    .t2-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
    .t2-ad-icons { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
    .t2-hero { padding: 28px 0 18px; }
    .t2-hero h1 { font-size: 23px; }
    .t2-hero-search input { padding: 11px 16px; font-size: 14px; }
    .t2-hero-search button { padding: 0 20px; }
    .t2-section { margin: 24px 0; }
    .t2-section-head h2 { font-size: 18px; }
    .t2-listhead h1 { font-size: 19px; }
    .t2-title { font-size: 17px; }
    .t2-panel { padding: 14px; }
    .t2-shots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .t2-footer-in { grid-template-columns: 1fr 1fr; gap: 20px; }
    .t2-btns .down_btn { flex: 1 1 auto; text-align: center; padding: 11px 14px; }
}

/* --------------------------------------------------------------- 全站工具类 */
/* 模板里大量使用但全站原本无定义，PC / 手机两套区块会同时渲染 */ } }
