/* 
 * iOS App Store Global Dark Mode Theme (iOS 6 Compatible)
 * 极致打磨深色模式，无 Flexbox 兼容渲染
 */

/* ==========================================================================
   Reset & Base
   ========================================================================== */
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, public, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video {
    margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit; vertical-align: baseline;
}
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display: block; }
body {
    line-height: 1;
    background-color: #000000;
    color: #FFFFFF;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
}
ol, ul { list-style: none; }
blockquote, q { quotes: none; }
blockquote:before, blockquote:after, q:before, q:after { content: ''; content: none; }
table { border-collapse: collapse; border-spacing: 0; }
a { text-decoration: none; color: #0A84FF; -webkit-tap-highlight-color: transparent; }
* { -webkit-box-sizing: border-box; box-sizing: border-box; }

/* Clearfix */
.clearfix:before, .clearfix:after { content: " "; display: table; }
.clearfix:after { clear: both; }

/* ==========================================================================
   Typography & Utilities
   ========================================================================== */
.text-heavy { font-weight: 800; }
.text-bold { font-weight: 600; }
.text-regular { font-weight: 400; }
.text-gray { color: #8E8E93; }
.text-white { color: #FFFFFF; }
.text-blue { color: #0A84FF; }
.text-truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ==========================================================================
   Header (App Store Top Bar)
   ========================================================================== */
.app-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 44px;
    background-color: rgba(28, 28, 30, 0.95);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    z-index: 1000;
    text-align: center;
    line-height: 44px;
}
.app-header-title {
    font-size: 17px;
    font-weight: 600;
    color: #FFF;
}
/* Header layout using absolute positioning instead of flex */
.app-header .header-left, .app-header .header-right {
    position: absolute;
    top: 0;
    height: 44px;
    padding: 0 16px;
}
.app-header .header-left { left: 0; }
.app-header .header-right { right: 0; }
.header-menu-icon {
    display: inline-block;
    width: 22px; height: 14px;
    border-top: 2px solid #0A84FF;
    border-bottom: 2px solid #0A84FF;
    vertical-align: middle;
}

/* ==========================================================================
   Main Container
   ========================================================================== */
.main-content {
    padding-top: 44px;
    padding-bottom: 80px; /* Space for Tab Bar */
    max-width: 600px;
    margin: 0 auto;
}

/* Page Titles */
.page-header {
    padding: 20px 20px 10px;
}
.page-title {
    font-size: 34px;
    font-weight: 800;
    letter-spacing: 0.4px;
    margin-bottom: 0;
}

/* ==========================================================================
   Today Featured Cards (活动大方形卡片)
   ========================================================================== */
.today-card {
    position: relative;
    margin: 0 20px 30px;
    border-radius: 18px;
    background-color: #1C1C1E;
    overflow: hidden;
    -webkit-box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    display: block;
}
.today-card-img {
    width: 100%;
    height: 400px; /* Fixed height for the hero image */
    background-size: cover;
    background-position: center;
    position: relative;
}
.today-card-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 20px;
    /* Smooth gradient from dark to transparent */
    background: -webkit-linear-gradient(bottom, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0) 100%);
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0) 100%);
}
.today-label {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    margin-bottom: 4px;
}
.today-title {
    font-size: 28px;
    font-weight: 800;
    color: #FFF;
    line-height: 1.2;
    margin-bottom: 6px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.today-subtitle {
    font-size: 15px;
    color: rgba(255,255,255,0.8);
}
/* Bottom bar within Today card */
.today-card-bottom {
    background-color: #1C1C1E;
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

/* ==========================================================================
   App List Items (时下热门列表 & 常规列表)
   ========================================================================== */
.list-section {
    margin: 0 20px 30px;
    background-color: #1C1C1E;
    border-radius: 16px;
    padding: 0 16px;
}
.section-header {
    padding: 20px 20px 10px;
}
.section-title {
    font-size: 22px;
    font-weight: 700;
    color: #FFF;
}
.section-subtitle {
    font-size: 15px;
    color: #8E8E93;
    margin-top: 2px;
}

.app-item {
    display: table;
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    table-layout: fixed;
}
.app-item:last-child {
    border-bottom: none;
}
.app-icon-cell {
    display: table-cell;
    width: 64px;
    vertical-align: middle;
}
.app-icon {
    width: 60px;
    height: 60px;
    border-radius: 13.5px; /* App Store squircle approximation */
    border: 1px solid rgba(255,255,255,0.1);
    display: block;
}
.app-info-cell {
    display: table-cell;
    vertical-align: middle;
    padding: 0 12px;
    overflow: hidden;
}
.app-title {
    font-size: 16px;
    font-weight: 600;
    color: #FFF;
    margin-bottom: 3px;
    display: block;
}
.app-desc {
    font-size: 13px;
    color: #8E8E93;
    display: block;
}
.app-action-cell {
    display: table-cell;
    width: 76px;
    vertical-align: middle;
    text-align: right;
}

/* ==========================================================================
   Buttons (The "Get" / "获取" Button)
   ========================================================================== */
.btn-get {
    display: inline-block;
    background-color: #2C2C2E;
    color: #0A84FF;
    font-size: 15px;
    font-weight: 700;
    height: 28px;
    line-height: 28px;
    padding: 0 18px;
    border-radius: 14px;
    text-align: center;
}
/* Brown/Gold Button variant from the screenshot (e.g. Share) */
.btn-gold {
    background-color: rgba(166, 124, 0, 0.2);
    color: #D4AF37;
}

/* ==========================================================================
   Product Details Page (post.php)
   ========================================================================== */
.product-header {
    display: table;
    width: 100%;
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    table-layout: fixed;
}
.product-icon-cell {
    display: table-cell;
    width: 138px;
    vertical-align: top;
}
.product-icon {
    width: 118px;
    height: 118px;
    border-radius: 26px;
    border: 1px solid rgba(255,255,255,0.1);
}
.product-info-cell {
    display: table-cell;
    vertical-align: top;
    padding-left: 16px;
}
.product-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 6px;
    color: #FFF;
}
.product-developer {
    font-size: 15px;
    color: #8E8E93;
    margin-bottom: 20px;
}
.product-actions {
    margin-top: 10px;
}

/* Stats Scroller (横向滑动的评价、年龄、排行等) */
.stats-scroller {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 0; /* remove inline-block gaps */
}
.stats-scroller::-webkit-scrollbar { display: none; }

.stat-item {
    display: inline-block;
    vertical-align: top;
    text-align: center;
    padding: 0 24px;
    border-right: 1px solid rgba(255,255,255,0.15);
}
.stat-item:first-child { padding-left: 0; }
.stat-item:last-child { border-right: none; padding-right: 0; }

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: #8E8E93;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: #8E8E93;
    margin-bottom: 4px;
}
.stat-sub {
    font-size: 13px;
    font-weight: 600;
    color: #8E8E93;
}
/* Star Ratings */
.stars {
    color: #8E8E93; /* Gray stars */
    font-size: 12px;
    letter-spacing: 1px;
}
.stars-active {
    color: #FFF; /* White stars for active */
}

/* Screenshots Gallery (横向滚动大图) */
.screenshots-scroller {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    padding: 20px;
    font-size: 0;
}
.screenshots-scroller::-webkit-scrollbar { display: none; }
.screenshot-img {
    display: inline-block;
    height: 400px; /* Fixed height for uniformity */
    width: auto;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
    margin-right: 12px;
}
.screenshot-img:last-child { margin-right: 0; }

.compatibility-note {
    padding: 0 20px 20px;
    font-size: 13px;
    color: #8E8E93;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* Description Block */
.description-block {
    padding: 20px;
    font-size: 15px;
    line-height: 1.5;
    color: #FFF;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    position: relative;
    overflow: hidden;
    max-height: 120px; /* collapsed state */
}
.description-block p {
    margin-bottom: 10px;
}
.description-block.expanded {
    max-height: none;
}
.read-more-btn {
    position: absolute;
    bottom: 0; right: 0;
    background-color: #000;
    padding: 0 20px 4px 10px;
    color: #0A84FF;
    font-size: 15px;
    cursor: pointer;
    box-shadow: -10px 0 10px #000;
}
.expanded .read-more-btn { display: none; }

/* Information List */
.info-section {
    padding: 20px 0;
}
.info-title {
    font-size: 20px;
    font-weight: 700;
    color: #FFF;
    padding: 0 20px 10px;
}
.info-list {
    padding: 0 20px;
}
.info-row {
    padding: 14px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.info-row:last-child { border-bottom: none; }
.info-row .info-label {
    float: left;
    color: #8E8E93;
    font-size: 15px;
}
.info-row .info-value {
    float: right;
    color: #FFF;
    font-size: 15px;
    max-width: 60%;
    text-align: right;
}

/* ==========================================================================
   Tab Bar (Bottom Navigation)
   ========================================================================== */
.tab-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 80px; /* Safe area for modern phones, classic height is 49px */
    background-color: rgba(28, 28, 30, 0.95); /* #1C1C1E */
    border-top: 1px solid rgba(255,255,255,0.1);
    display: table;
    width: 100%;
    table-layout: fixed;
    z-index: 1000;
}
/* iOS 6 blur fallback */
@supports (-webkit-backdrop-filter: blur(10px)) {
    .tab-bar {
        background-color: rgba(28, 28, 30, 0.7);
        -webkit-backdrop-filter: saturate(180%) blur(20px);
        backdrop-filter: saturate(180%) blur(20px);
    }
    .app-header {
        background-color: rgba(28, 28, 30, 0.7);
        -webkit-backdrop-filter: saturate(180%) blur(20px);
        backdrop-filter: saturate(180%) blur(20px);
    }
}
.tab-item {
    display: table-cell;
    text-align: center;
    vertical-align: top;
    padding-top: 8px;
    color: #8E8E93;
}
.tab-item.active {
    color: #0A84FF;
}
.tab-icon {
    font-size: 24px;
    display: block;
    margin-bottom: 2px;
}
.tab-text {
    font-size: 10px;
    font-weight: 500;
    display: block;
}

/* ==========================================================================
   Search Overlay
   ========================================================================== */
.search-overlay {
    display: none;
    position: fixed;
    top: 44px; left: 0; right: 0; bottom: 80px;
    background-color: #000;
    z-index: 900;
    padding: 20px;
    overflow-y: auto;
}
.search-overlay.active { display: block; }
.search-box {
    position: relative;
    margin-bottom: 30px;
}
.search-input {
    width: 100%;
    height: 36px;
    background-color: #1C1C1E;
    border: none;
    border-radius: 10px;
    padding: 0 12px 0 36px;
    font-size: 17px;
    color: #FFF;
    outline: none;
}
.search-icon {
    position: absolute;
    left: 10px; top: 9px;
    color: #8E8E93;
    font-size: 18px;
}
.search-tags-title {
    font-size: 20px;
    font-weight: 700;
    color: #FFF;
    margin-bottom: 16px;
}
.search-tags a {
    display: inline-block;
    padding: 8px 16px;
    background-color: #1C1C1E;
    color: #0A84FF;
    border-radius: 16px;
    margin: 0 8px 8px 0;
    font-size: 15px;
}

/* ==========================================================================
   Comments (Ratings & Reviews)
   ========================================================================== */
.reviews-section {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}
.reviews-header {
    font-size: 22px;
    font-weight: 700;
    color: #FFF;
    margin-bottom: 16px;
}
.review-card {
    background-color: #1C1C1E;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}
.review-meta {
    margin-bottom: 6px;
}
.review-meta .review-author {
    font-weight: 600;
    color: #FFF;
    font-size: 15px;
}
.review-meta .review-date {
    float: right;
    color: #8E8E93;
    font-size: 13px;
}
.review-stars {
    color: #FF9500; /* Apple's star color for reviews is usually orange-ish or white */
    font-size: 14px;
    margin-bottom: 8px;
}
.review-content {
    color: #FFF;
    font-size: 15px;
    line-height: 1.4;
}
.write-review-btn {
    display: block;
    text-align: center;
    color: #0A84FF;
    font-size: 16px;
    font-weight: 600;
    margin: 20px 0;
    cursor: pointer;
}
#comment-form {
    display: none;
    background-color: #1C1C1E;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}
#comment-form.active { display: block; }
.comment-input {
    width: 100%;
    background-color: #000;
    border: 1px solid rgba(255,255,255,0.1);
    color: #FFF;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 15px;
}
.comment-submit {
    width: 100%;
    background-color: #0A84FF;
    color: #FFF;
    border: none;
    border-radius: 8px;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
}
