/*
Theme Name: ROM Resource Station
Theme URI: http://boot.cn
Author: Custom
Version: 1.1
Text Domain: rom-theme
*/

/* ========================================
   基础重置与 WordPress 必要样式
   ======================================== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.5;
    min-width: 320px;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }

.aligncenter { display: block; margin: 0 auto; }
.alignleft { float: left; margin-right: 15px; }
.alignright { float: right; margin-left: 15px; }
.wp-caption { max-width: 100%; }

/* ========================================
   头部区域 - 无搜索框版本
   ======================================== */
.site-header {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 20px;
}


/* 返回按钮 */
.back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 20px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-right: 8px;
}
.back-btn:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}
.back-btn svg {
    flex-shrink: 0;
}

/* Logo */
.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.logo-area .custom-logo {
    max-height: 36px;
    width: auto;
}

.site-title-text {
    font-size: 20px;
    font-weight: 700;
    color: #38bdf8;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
    white-space: nowrap;
}

/* 导航菜单 */
.main-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 8px;
    align-items: center;
}

.main-nav ul li { position: relative; }

.main-nav ul li a {
    display: block;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #cbd5e1;
    border-radius: 20px;
    transition: all 0.2s ease;
}

.main-nav ul li a:hover,
.main-nav ul li.current-menu-item a,
.main-nav ul li.current_page_item a {
    color: #fff;
    background: rgba(59, 130, 246, 0.25);
}

/* 下拉菜单 */
.main-nav ul li ul.sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #1e293b;
    border-radius: 8px;
    padding: 8px 0;
    min-width: 160px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    flex-direction: column;
    gap: 0;
}

.main-nav ul li:hover ul.sub-menu { display: flex; }

.main-nav ul li ul.sub-menu li a {
    padding: 8px 16px;
    border-radius: 0;
    white-space: nowrap;
}

/* 返回按钮（详情页专用） */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.back-btn:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

.back-btn svg {
    width: 16px;
    height: 16px;
}

/* 移动端汉堡菜单 */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* ========================================
   首页 - 主界面样式
   ======================================== */
.page-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 15px 30px;
}

.page-header-banner {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #fff;
    padding: 50px 24px 40px;
    border-radius: 0 0 16px 16px;
    text-align: center;
    margin-bottom: 28px;
    margin-top: -1px;
}

.page-header-banner h1 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 8px;
}

.page-header-banner .site-url {
    font-size: 22px;
    font-weight: 700;
    color: #38bdf8;
    letter-spacing: 1.5px;
    margin: 8px 0 12px;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

.page-header-banner .header-desc {
    font-size: 14px;
    color: #cbd5e1;
    margin-bottom: 24px;
}

.home-search-box {
    max-width: 520px;
    margin: 0 auto;
    position: relative;
}

.home-search-box input {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 24px;
    font-size: 14px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    outline: none;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.2s ease;
}

.home-search-box input::placeholder { color: rgba(255,255,255,0.6); }

.home-search-box input:focus {
    background: rgba(255,255,255,0.25);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* 筛选区域 */
.filter-section { margin-bottom: 24px; }

.filter-label.brand-label {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 10px;
    padding-left: 4px;
}

.filter-label.series-label {
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 8px;
    padding-left: 4px;
}

.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.category-btn {
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-family: inherit;
}

.brand-filter .category-btn {
    padding: 9px 20px;
    font-size: 14px;
    border-radius: 24px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    color: #475569;
}

.brand-filter .category-btn.active {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}

.brand-filter .category-btn:hover:not(.active) {
    border-color: #cbd5e1;
    background-color: #f1f5f9;
}

.series-filter { display: none; }
.series-filter.show { display: flex; }

.series-filter .category-btn {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 16px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    color: #64748b;
}

.series-filter .category-btn.active {
    background-color: #eff6ff;
    border-color: #3b82f6;
    color: #2563eb;
}

.series-filter .category-btn:hover:not(.active) {
    border-color: #cbd5e1;
    background-color: #f8fafc;
}

/* 卡片网格 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
    justify-items: center;
}

/* 单个卡片 */
.resource-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 300px;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.resource-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background-color: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
    z-index: 1;
}

.card-img-container {
    position: relative;
    width: 100%;
    padding-top: 100%;
    background-color: #f8fafc;
    overflow: hidden;
}

.card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.card-content { padding: 14px 14px 16px; }

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    background-color: #f1f5f9;
    color: #64748b;
    font-weight: 500;
}

.card-name {
    text-align: left;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 访问次数标签 */
.view-count {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.view-count::before {
    content: '👁';
    font-size: 10px;
}

/* 空状态 */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
    font-size: 14px;
    display: none;
}
.empty-state.show { display: block; }

/* ========================================
   机型详情页 - 二级子界面样式
   ======================================== */
.model-detail-container {
    max-width: 900px;
    margin: 30px auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* ✅ 机型详情页去掉上边距，紧贴导航栏 */
body.model-detail-page .model-detail-container {
    margin-top: 0;
    border-radius: 0 0 12px 12px;
}

.model-header {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #fff;
    padding: 24px;
    position: relative;
}

/* .model-header .header-actions 已移除 — 返回按钮在导航栏中 */

.model-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 6px;
}

.model-header .site-url {
    font-size: 20px;
    font-weight: bold;
    color: #38bdf8;
    letter-spacing: 1px;
    margin: 10px 0;
    text-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

.model-header p {
    font-size: 14px;
    color: #cbd5e1;
}

/* 访问统计 */
.model-stats {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    font-size: 13px;
    color: #94a3b8;
}

.model-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.model-content { padding: 24px; }

/* 版本分组标题 */
.version-group-title {
    font-size: 18px;
    font-weight: 600;
    color: #1e293b;
    margin: 28px 0 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #3b82f6;
    display: inline-block;
}
.version-group-title:first-child { margin-top: 0; }

/* 版本项 */
.version-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    margin-bottom: 12px;
    background-color: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}
.version-item:hover {
    border-color: #cbd5e1;
    background-color: #f1f5f9;
}

.version-info { flex: 1; min-width: 0; }
.version-info h3 {
    font-size: 16px;
    color: #1e293b;
    margin-bottom: 4px;
}
.version-source {
    font-size: 13px;
    color: #64748b;
}

.version-views {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}

.download-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #ffffff;
    border: none;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 90px;
    white-space: nowrap;
}

.mirror-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}
.mirror-btn:hover {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.4);
}

.rom-btn {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}
.rom-btn:hover {
    background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.4);
}

.firmware-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}
.firmware-btn:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(245, 158, 11, 0.4);
}

.download-btn[href=""],
.download-btn[href="#"],
.download-btn.btn-hide { display: none !important; }

/* 底部提示 */
.tips {
    margin-top: 24px;
    padding: 16px;
    background-color: #f8fafc;
    border-radius: 8px;
    font-size: 13px;
    color: #64748b;
    border-left: 4px solid #3b82f6;
}
.tips h3 {
    font-size: 14px;
    color: #334155;
    margin-bottom: 8px;
}

/* 机型基础信息 */
.model-basic-info {
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 20px;
}
.model-basic-info .model-code {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 16px;
}

/* ========================================
   底部
   ======================================== */
.site-footer {
    background: #1e293b;
    color: #94a3b8;
    text-align: center;
    padding: 24px;
    font-size: 13px;
    margin-top: 40px;
}

/* ========================================
   响应式适配
   ======================================== */
@media (max-width: 768px) {
    .header-inner { padding: 0 16px; }

    .mobile-menu-toggle { display: flex; }

    .main-nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: #1e293b;
        padding: 16px;
        flex-direction: column;
        gap: 4px;
        box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    }

    .main-nav.active { display: flex; }

    .main-nav ul { flex-direction: column; gap: 4px; width: 100%; }
    .main-nav ul li { width: 100%; }
    .main-nav ul li a { padding: 10px 16px; border-radius: 8px; }
    .main-nav ul li ul.sub-menu {
        position: static;
        box-shadow: none;
        padding-left: 16px;
        background: transparent;
        display: flex !important;
    }

    .back-btn { padding: 6px 12px; font-size: 13px; }

    .page-header-banner { padding: 28px 16px; margin-bottom: 20px; }
    .page-header-banner h1 { font-size: 24px; }
    .page-header-banner .site-url { font-size: 18px; }
    .page-header-banner .header-desc { font-size: 13px; }

    .category-filter { gap: 6px; margin-bottom: 14px; }
    .brand-filter .category-btn { padding: 7px 16px; font-size: 13px; }
    .series-filter .category-btn { padding: 5px 12px; font-size: 12px; }

    .card-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
        justify-items: stretch;
    }
    .resource-card { max-width: none; }
    .card-badge { font-size: 11px; padding: 3px 8px; top: 8px; left: 8px; }
    .card-content { padding: 12px 10px; }
    .card-name { font-size: 14px; }

    .model-header { padding: 20px 16px; }
    .model-header .header-actions { margin-bottom: 12px; }
    .model-content { padding: 16px; }
    .version-item { flex-direction: column; align-items: flex-start; gap: 12px; }
    .download-btn-group { width: 100%; }
    .download-btn { flex: 1; min-width: unset; padding: 10px 12px; }
}

@media (max-width: 375px) {
    .page-container { padding: 0 10px 20px; }
    .card-grid { gap: 10px; }
}
