/* ==========================================================================
   InkWave · WordPress 网格风主题（模板3）
   配色取自 WordPress 经典调色板（#1d2327 / #2271b1 / #f0f0f1 …）
   布局：全宽无侧栏，视频网格一行 4 个
   ========================================================================== */

:root {
    --iw-bg: #f0f0f1;
    --iw-surface: #ffffff;
    --iw-ink: #3c434a;
    --iw-heading: #1d2327;
    --iw-muted: #787c82;
    --iw-line: #dcdcde;
    --iw-line-light: #f0f0f1;
    --iw-accent: #2271b1;
    --iw-accent-d: #135e96;
    --iw-dark: #1d2327;
    --iw-dark-2: #2c3338;
    --iw-font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body.iw-body {
    font-family: var(--iw-font);
    background: var(--iw-bg);
    color: var(--iw-ink);
    font-size: 15px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--iw-accent); text-decoration: none; }
a:hover { color: var(--iw-accent-d); }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

.iw-wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }

/* --------------------------------------------------------------------------
   顶部工具条
   -------------------------------------------------------------------------- */
.iw-utilbar { background: var(--iw-dark); color: #c3c4c7; font-size: 0.78rem; }
.iw-utilbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; }
.iw-util-date { color: #a7aaad; }
.iw-util-links a { color: #c3c4c7; margin-left: 14px; }
.iw-util-links a:hover { color: #72aee6; }

/* --------------------------------------------------------------------------
   站点头部
   -------------------------------------------------------------------------- */
.iw-header { background: var(--iw-surface); border-bottom: 1px solid var(--iw-line); }
.iw-header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 20px; padding-bottom: 20px; }
.iw-logo { display: inline-block; font-size: 2rem; line-height: 1.2; font-weight: 800; color: var(--iw-heading); }
.iw-logo:hover { color: var(--iw-accent); }
.iw-logo span { color: var(--iw-accent); }
.iw-tagline { font-size: 0.82rem; color: var(--iw-muted); margin-top: 4px; }
.iw-search { display: flex; border: 1px solid var(--iw-line); background: #f6f7f7; max-width: 340px; flex: 1; border-radius: 3px; overflow: hidden; }
.iw-search input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; padding: 10px 12px; font-size: 0.9rem; font-family: inherit; color: var(--iw-ink); }
.iw-search button { border: none; background: var(--iw-accent); color: #fff; padding: 0 18px; font-size: 0.88rem; }
.iw-search button:hover { background: var(--iw-accent-d); }

/* --------------------------------------------------------------------------
   主导航（WP 菜单栏）
   -------------------------------------------------------------------------- */
.iw-navbar { background: var(--iw-dark-2); }
.iw-navbar-inner { display: flex; align-items: stretch; }
.iw-menu-btn { display: none; background: transparent; border: none; color: #f0f0f1; font-size: 1.2rem; padding: 12px 14px; }
.iw-nav { display: flex; list-style: none; }
.iw-nav > li { position: relative; }
.iw-nav > li > a { display: block; padding: 12px 18px; color: #f0f0f1; font-size: 0.92rem; }
.iw-nav > li > a:hover { background: var(--iw-dark); color: #72aee6; }
.iw-nav > li > a.is-active { background: var(--iw-accent); color: #fff; }
.iw-drop-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 170px;
    background: #fff;
    border: 1px solid var(--iw-line);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
    display: none;
    z-index: 80;
    padding: 6px 0;
}
.iw-nav-drop:hover .iw-drop-menu,
.iw-nav-drop.is-open .iw-drop-menu { display: block; }
.iw-drop-menu a { display: block; padding: 8px 16px; color: var(--iw-ink); font-size: 0.88rem; }
.iw-drop-menu a:hover { background: var(--iw-bg); color: var(--iw-accent); }

/* --------------------------------------------------------------------------
   面包屑
   -------------------------------------------------------------------------- */
.iw-crumbs { font-size: 0.82rem; color: var(--iw-muted); margin-bottom: 14px; }
.iw-crumbs a { color: var(--iw-accent); }
.iw-crumb-sep { margin: 0 8px; color: #a7aaad; }
.iw-crumb-cur { color: var(--iw-muted); }

/* --------------------------------------------------------------------------
   广告位
   -------------------------------------------------------------------------- */
.iw-adzone { position: relative; border: 1px dashed #c3c4c7; background: #fbfbfc; padding: 12px 12px 10px; margin: 16px 0; }
.iw-adzone-tag { position: absolute; top: -9px; left: 12px; background: var(--iw-bg); padding: 0 7px; font-size: 0.68rem; letter-spacing: 0.18em; color: var(--iw-muted); }
.iw-adzone-inner { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; min-height: 54px; overflow: hidden; }
.iw-adzone-inner img, .iw-adzone-inner iframe { max-width: 100%; }
.iw-adzone-inner .ad-banner { margin: 4px; }
.iw-adzone-mid { margin-top: 22px; }

/* --------------------------------------------------------------------------
   主内容区（全宽，无侧栏）
   -------------------------------------------------------------------------- */
.iw-layout { padding-top: 26px; padding-bottom: 10px; }
.iw-content { min-width: 0; }
.iw-friendly-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 18px;
    margin-bottom: 20px;
    padding: 10px 16px;
    background: #fff;
    border: 1px solid #e6e8ee;
    border-radius: 6px;
}
.iw-friendly-links a { font-size: 0.85rem; color: #555; }
.iw-friendly-links a:hover { color: #2271b1; }

/* --------------------------------------------------------------------------
   归档页头
   -------------------------------------------------------------------------- */
.iw-archive-head { display: flex; align-items: baseline; gap: 12px; border-bottom: 2px solid var(--iw-line); padding-bottom: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.iw-archive-title { font-size: 1.45rem; color: var(--iw-heading); font-weight: 700; }
.iw-archive-count { font-size: 0.85rem; color: var(--iw-muted); }
.iw-archive-search { display: flex; border: 1px solid var(--iw-line); background: var(--iw-surface); margin-bottom: 18px; max-width: 520px; border-radius: 3px; overflow: hidden; }
.iw-archive-search input { flex: 1; min-width: 0; padding: 10px 12px; border: none; outline: none; font-size: 0.9rem; font-family: inherit; color: var(--iw-ink); }
.iw-archive-search button { border: none; background: var(--iw-accent); color: #fff; padding: 0 20px; font-size: 0.88rem; }
.iw-archive-search button:hover { background: var(--iw-accent-d); }

/* --------------------------------------------------------------------------
   置顶推荐（WP sticky post）
   -------------------------------------------------------------------------- */
.iw-feature { display: grid; grid-template-columns: 320px 1fr; background: var(--iw-surface); border: 1px solid var(--iw-line); margin-bottom: 22px; transition: box-shadow 0.18s ease; }
.iw-feature:hover { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1); }
.iw-feature-thumb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #e8e8e8; }
.iw-feature-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 2; }
.iw-feature-info { padding: 16px 20px; display: flex; flex-direction: column; justify-content: center; }
.iw-feature-label { align-self: flex-start; font-size: 0.72rem; letter-spacing: 0.12em; background: var(--iw-accent); color: #fff; padding: 2px 9px; margin-bottom: 10px; }
.iw-feature-title { font-size: 1.15rem; color: var(--iw-heading); line-height: 1.5; margin-bottom: 10px; }
.iw-feature:hover .iw-feature-title { color: var(--iw-accent); }

/* --------------------------------------------------------------------------
   视频网格（网格式：全宽一行 4 个）
   -------------------------------------------------------------------------- */
.iw-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px 16px; }
.iw-card { display: flex; flex-direction: column; background: var(--iw-surface); border: 1px solid var(--iw-line); transition: box-shadow 0.18s ease, transform 0.18s ease; }
.iw-card:hover { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12); transform: translateY(-2px); }
.iw-card-thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #e8e8e8; }
.iw-card-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 2; }
.iw-thumb-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.6rem; letter-spacing: 0.25em; color: #c3c4c7; z-index: 1; }
.iw-duration-badge { position: absolute; right: 8px; bottom: 8px; z-index: 3; background: rgba(0, 0, 0, 0.72); color: #fff; font-size: 0.72rem; padding: 1px 7px; border-radius: 2px; }
.iw-card-body { padding: 10px 12px 12px; }
.iw-card-title { font-size: 0.92rem; font-weight: 600; color: var(--iw-heading); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.8em; }
.iw-card:hover .iw-card-title { color: var(--iw-accent); }
.iw-card-meta { margin-top: 8px; font-size: 0.76rem; color: var(--iw-muted); }
.iw-meta-sep { margin: 0 6px; color: #c3c4c7; }
.iw-meta-cat { color: var(--iw-accent); }

/* 网格广告 */
.iw-grid-ad { position: relative; border: 1px dashed #c3c4c7; background: #fbfbfc; display: flex; align-items: center; justify-content: center; overflow: hidden; min-height: 190px; padding: 10px; }
.iw-grid-ad-tag { position: absolute; top: 6px; left: 8px; font-size: 0.66rem; letter-spacing: 0.18em; color: var(--iw-muted); }
.iw-grid-ad img, .iw-grid-ad iframe, .iw-grid-ad .ad-banner { max-width: 100%; }

/* --------------------------------------------------------------------------
   分类目录页（全宽一行 4 个）
   -------------------------------------------------------------------------- */
.iw-cat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.iw-cat-card { display: flex; flex-direction: column; gap: 6px; background: var(--iw-surface); border: 1px solid var(--iw-line); border-left: 4px solid var(--iw-accent); padding: 16px 16px 14px; transition: box-shadow 0.18s ease; }
.iw-cat-card:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1); }
.iw-cat-name { font-size: 1.05rem; font-weight: 700; color: var(--iw-heading); }
.iw-cat-card:hover .iw-cat-name { color: var(--iw-accent); }
.iw-cat-count { font-size: 0.8rem; color: var(--iw-muted); }

/* --------------------------------------------------------------------------
   公告（WP 文章流）
   -------------------------------------------------------------------------- */
.iw-posts { display: flex; flex-direction: column; gap: 16px; }
.iw-post { background: var(--iw-surface); border: 1px solid var(--iw-line); padding: 18px 20px 16px; }
.iw-post-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.iw-post-badge { color: #fff; font-size: 0.72rem; padding: 2px 10px; }
.iw-post-date { font-size: 0.78rem; color: var(--iw-muted); }
.iw-post-title { font-size: 1.2rem; color: var(--iw-heading); margin-bottom: 8px; }
.iw-post-content { font-size: 0.92rem; color: #50575e; white-space: pre-line; }

/* --------------------------------------------------------------------------
   视频详情（WP 单页）
   -------------------------------------------------------------------------- */
.iw-article { background: var(--iw-surface); border: 1px solid var(--iw-line); padding: 20px 22px 22px; }
.iw-article-title { font-size: 1.55rem; line-height: 1.45; color: var(--iw-heading); margin-bottom: 10px; }
.iw-post-meta { font-size: 0.82rem; color: var(--iw-muted); margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--iw-line-light); }
.iw-player-frame { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; margin-bottom: 14px; }
.iw-player-poster { position: absolute; inset: 0; z-index: 2; background: #0d0d0d; transition: opacity 0.25s ease; }
.iw-player-poster.is-hidden { opacity: 0; pointer-events: none; }
.iw-player-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.9; }
.iw-play-btn { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 82px; height: 82px; border-radius: 50%; border: none; background: rgba(255, 255, 255, 0.92); color: #1d2327; font-size: 1.5rem; padding-left: 7px; box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35); transition: transform 0.18s ease, background 0.18s ease; }
.iw-play-btn:hover { transform: translate(-50%, -50%) scale(1.06); background: #fff; color: var(--iw-accent); }
.iw-player-duration { position: absolute; right: 10px; bottom: 10px; z-index: 3; background: rgba(0, 0, 0, 0.72); color: #fff; font-size: 0.78rem; padding: 2px 9px; border-radius: 2px; }
.iw-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; z-index: 1; }
.iw-player-error { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; background: rgba(178, 31, 31, 0.94); color: #fff; padding: 9px 14px; font-size: 0.86rem; }

/* VAST 前贴片层 */
.iw-vast-overlay { position: absolute; inset: 0; z-index: 5; background: #000; }
.iw-vast-overlay video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.iw-vast-badge { position: absolute; top: 12px; left: 12px; z-index: 2; background: rgba(255, 255, 255, 0.9); color: var(--iw-heading); font-size: 0.72rem; letter-spacing: 0.22em; padding: 3px 10px; }
.iw-vast-skip { position: absolute; top: 12px; right: 12px; z-index: 2; border: 1px solid rgba(255, 255, 255, 0.7); background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 0.82rem; padding: 6px 14px; }
.iw-vast-skip:hover { background: var(--iw-accent); border-color: var(--iw-accent); }
.iw-vast-sound { position: absolute; left: 12px; bottom: 12px; z-index: 2; border: 1px solid rgba(255, 255, 255, 0.7); background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 0.82rem; padding: 6px 14px; }
.iw-vast-sound:hover { background: rgba(34, 113, 177, 0.9); }

/* 互动按钮 */
.iw-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.iw-action { border: 1px solid var(--iw-line); background: #f6f7f7; color: var(--iw-ink); font-size: 0.86rem; padding: 8px 18px; border-radius: 3px; transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease; }
.iw-action:hover { background: var(--iw-accent); border-color: var(--iw-accent); color: #fff; }
.iw-action.is-active { background: var(--iw-accent); border-color: var(--iw-accent); color: #fff; }

/* 简介 + 相关 */
.iw-post-content { border-left: 3px solid var(--iw-accent); background: #f6f7f7; padding: 14px 18px; margin-bottom: 20px; }
.iw-post-content h3 { font-size: 0.95rem; color: var(--iw-heading); margin-bottom: 6px; }
.iw-post-content p { font-size: 0.9rem; color: #50575e; white-space: pre-line; }
.iw-related-head { display: flex; align-items: baseline; border-bottom: 2px solid var(--iw-line); padding-bottom: 8px; margin: 22px 0 16px; }
.iw-related-head h2 { font-size: 1.15rem; color: var(--iw-heading); }

/* --------------------------------------------------------------------------
   分页（WP 分页链接样式）
   -------------------------------------------------------------------------- */
.iw-pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 26px 0 6px; flex-wrap: wrap; }
.iw-page { min-width: 36px; height: 36px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--iw-line); background: var(--iw-surface); color: var(--iw-ink); font-size: 0.88rem; }
.iw-page:hover { border-color: var(--iw-accent); color: var(--iw-accent); }
.iw-page.is-active { background: var(--iw-accent); border-color: var(--iw-accent); color: #fff; }
.iw-page-gap { border: none; background: transparent; color: var(--iw-muted); }
.iw-page-label { color: var(--iw-muted); }

/* --------------------------------------------------------------------------
   空状态
   -------------------------------------------------------------------------- */
.iw-empty { grid-column: 1 / -1; text-align: center; padding: 60px 20px; color: var(--iw-muted); border: 1px dashed var(--iw-line); background: var(--iw-surface); font-size: 0.92rem; }

/* --------------------------------------------------------------------------
   页脚
   -------------------------------------------------------------------------- */
.iw-footer { background: var(--iw-dark); color: #a7aaad; margin-top: 34px; }
.iw-footer-widgets { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 28px; padding-top: 34px; padding-bottom: 26px; }
.iw-fw-title { font-size: 0.95rem; color: #fff; border-bottom: 1px solid #3c434a; padding-bottom: 10px; margin-bottom: 12px; }
.iw-fw-text { font-size: 0.84rem; color: #a7aaad; line-height: 1.8; }
.iw-fw-links { list-style: none; }
.iw-fw-links a { display: block; font-size: 0.84rem; color: #a7aaad; padding: 3px 0; }
.iw-fw-links a:hover { color: #72aee6; }
.iw-footer-bar { background: #101517; border-top: 1px solid #2c3338; }
.iw-footer-bar-inner { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 46px; font-size: 0.78rem; color: #787c82; }

/* --------------------------------------------------------------------------
   响应式
   -------------------------------------------------------------------------- */
@media (max-width: 1040px) {
    .iw-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .iw-cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .iw-header-inner { flex-wrap: wrap; }
    .iw-search { max-width: none; }
    .iw-menu-btn { display: block; }
    .iw-navbar-inner { flex-wrap: wrap; }
    .iw-nav { display: none; flex-direction: column; flex-basis: 100%; }
    .iw-nav.is-open { display: flex; }
    .iw-nav > li > a { padding: 11px 16px; border-top: 1px solid rgba(255, 255, 255, 0.06); }
    .iw-nav-drop { position: static; }
    .iw-drop-menu { position: static; box-shadow: none; border: none; background: var(--iw-dark); padding: 0 0 4px 14px; }
    .iw-drop-menu a { color: #c3c4c7; }
    .iw-drop-menu a:hover { background: transparent; color: #72aee6; }
}

@media (max-width: 640px) {
    .iw-header-inner { padding-top: 14px; padding-bottom: 14px; }
    .iw-logo { font-size: 1.6rem; }
    .iw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .iw-feature { grid-template-columns: 1fr; }
    .iw-feature-thumb { aspect-ratio: 16 / 9; }
    .iw-cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .iw-article { padding: 14px; }
    .iw-article-title { font-size: 1.25rem; }
    .iw-play-btn { width: 64px; height: 64px; font-size: 1.2rem; }
    .iw-footer-widgets { grid-template-columns: 1fr 1fr; gap: 20px; }
}

@media (max-width: 420px) {
    .iw-footer-widgets { grid-template-columns: 1fr; }
}
