/*
Theme Name: OS Download Theme
Theme URI: http://example.com/os-download-theme/
Author: Your Name
Author URI: http://example.com/
Description: A modern WordPress theme for operating system download website with VIP membership and top-up functionalities.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: os-download-theme
Tags: download, operating-system, vip, membership
*/

/* 导入字体 */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* 全局样式 */
:root {
    --primary-color: #2b7de1;
    --primary-hover: #1a68c9;
    --secondary-color: #6c757d;
    --accent-color: #ff6b6b;
    --accent-hover: #ff5252;
    --vip-color: #ffb700;
    --vip-hover: #e6a500;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --light-bg: #f8f9fa;
    --dark-bg: #212529;
    --border-color: #e9ecef;
    --text-color: #495057;
    --text-light: #6c757d;
    --text-dark: #343a40;
    --white: #ffffff;
    --shadow-sm: 0 .125rem .25rem rgba(0,0,0,.075);
    --shadow: 0 .5rem 1rem rgba(0,0,0,.15);
    --shadow-lg: 0 1rem 3rem rgba(0,0,0,.175);
    --transition: all 0.3s ease;
    --radius: 8px;
    --radius-sm: 4px;
    --radius-lg: 12px;
}

/* 网站通知样式 */
.site-notifications {
    margin-bottom: 15px;
}

.notification-item {
    padding: 10px 15px;
    margin-bottom: 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
}

.notification-item i {
    margin-right: 10px;
    font-size: 16px;
}

.notification-item.info {
    background-color: #d1ecf1;
    border-left: 4px solid #0dcaf0;
    color: #055160;
}

.notification-item.success {
    background-color: #d1e7dd;
    border-left: 4px solid #198754;
    color: #0f5132;
}

.notification-item.warning {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    color: #664d03;
}

.notification-item.danger {
    background-color: #f8d7da;
    border-left: 4px solid #dc3545;
    color: #842029;
}

body {
    font-family: 'Poppins', 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--light-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
    text-decoration: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 头部样式 */
.site-header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 15px 0;
}

.site-branding {
    float: left;
}

.site-title {
    margin: 0;
    font-size: 24px;
    font-weight: bold;
}

.site-description {
    margin: 5px 0 0;
    font-size: 13px;
    color: #777;
}

/* 导航菜单 */
.main-navigation {
    float: right;
    margin-top: 10px;
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-navigation li {
    float: left;
    position: relative;
    margin-left: 20px;
}

.main-navigation a {
    display: block;
    padding: 5px 10px;
    color: #333;
    font-weight: bold;
}

.main-navigation a:hover {
    color: #0066cc;
}

/* 内容区域 */
.content-area {
    background-color: #fff;
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* 下载项目卡片 */
.download-item {
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background-color: var(--white);
    overflow: hidden;
}

.download-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

/* 长条式布局样式 */
.download-item-horizontal {
    transition: all 0.3s ease;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    background-color: var(--white);
}

.download-item-horizontal:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12) !important;
}

.download-item-horizontal .download-item-thumb {
    height: 120px;
    overflow: hidden;
}

.download-item-horizontal .download-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.download-item-horizontal:hover .download-item-thumb img {
    transform: scale(1.05);
}

.download-item-thumb {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius) var(--radius) 0 0;
    height: 200px;
}

.download-item-thumb img {
    transition: transform 0.5s ease;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.download-item:hover .download-item-thumb img {
    transform: scale(1.05);
}

.vip-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #333;
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    z-index: 2;
}

.download-item-title {
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    line-height: 1.4;
    padding: 0 15px;
}

.download-item-title a {
    color: #333;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.download-item-title a:hover {
    color: #007bff;
}

.download-item-meta {
    margin-bottom: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    padding: 0 15px;
    color: var(--text-light);
    font-size: 0.85rem;
}

.download-item-meta span {
    display: inline-flex;
    align-items: center;
}

.download-item-meta i {
    margin-right: 0.25rem;
    color: var(--primary-color);
}

.download-item-meta .badge {
    font-size: 11px;
    padding: 4px 8px;
}

.download-actions {
    min-width: 120px;
}

.download-stats {
    font-size: 12px;
}

.download-footer {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding: 0.75rem 15px;
}

/* 章节标题样式 */
.section-header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title {
    position: relative;
    font-weight: 600;
    margin: 0;
}

.view-more {
    font-size: 0.9rem;
    color: var(--text-light);
    transition: var(--transition);
}

.view-more:hover {
    color: var(--primary-color);
}

.view-more i {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.view-more:hover i {
    transform: translateX(3px);
}

/* 侧边栏样式 */
.sidebar {
    padding: 0;
}

.widget {
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
}

.widget-header {
    padding: 12px 15px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #eee;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.widget-content {
    padding: 15px;
}

/* 登录小部件 */
.login-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
}

.login-links a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* 用户信息小部件 */
.user-info .user-name {
    font-size: 16px;
    color: #333;
}

.user-vip-status .vip-badge {
    background-color: var(--vip-color);
    color: #fff;
    padding: 2px 8px;
    border-radius: 30px;
    font-size: 12px;
    display: inline-block;
}

.user-vip-status .vip-expiry {
    color: #666;
}

/* VIP会员特权 */
.vip-info {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.vip-info h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--vip-color);
}

.vip-info:before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, transparent 70%, rgba(255, 215, 0, 0.2) 100%);
    z-index: 0;
}

.vip-benefits li {
    position: relative;
    padding-left: 5px;
    font-size: 14px;
}

.vip-price .price-tag {
    display: inline-block;
    margin-right: 15px;
}

.vip-price .amount {
    font-size: 24px;
    font-weight: bold;
    color: var(--vip-color);
}

.vip-price .period {
    font-size: 14px;
    color: #666;
}

.vip-price .yearly {
    position: relative;
}

.vip-price .discount {
    background-color: #ff6b6b;
    color: #fff;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 5px;
    position: relative;
    top: -2px;
}

.btn-vip {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    border: none;
    color: #333;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-vip:hover {
    background: linear-gradient(135deg, #ffed4e, #ffd700);
    color: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .download-item-horizontal .col-md-3,
    .download-item-horizontal .col-md-9 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .download-item-horizontal .download-item-thumb {
        height: 180px;
    }
    
    .download-actions {
        text-align: center !important;
        margin-top: 15px;
    }
}

/* 热门下载列表 */
.popular-downloads-list {
    background-color: #fff;
}

.popular-download-item {
    transition: background-color 0.2s ease;
}

.popular-download-item:hover {
    background-color: #f8f9fa;
}

.popular-download-item:last-child {
    border-bottom: none !important;
}

.popular-download-thumb img {
    width: 50px;
    height: 50px;
    object-fit: cover;
}

.popular-download-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.popular-download-title a:hover {
    color: var(--primary-color);
}

.popular-download-title .vip-badge {
    color: var(--vip-color);
    font-size: 12px;
}

/* 分类列表 */
.categories-list .category-item a {
    color: #333;
    text-decoration: none;
    padding: 8px 0;
    transition: all 0.2s ease;
    display: block;
}

.categories-list .category-item a:hover {
    color: var(--primary-color);
    transform: translateX(3px);
}

/* 充值表单 */
.recharge-form {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.recharge-form h3 {
    margin-top: 0;
    margin-bottom: 15px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.btn {
    display: inline-block;
    padding: 8px 15px;
    background-color: #0066cc;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-weight: bold;
}

.btn:hover {
    background-color: #004499;
}

/* 页脚样式 */
.site-footer {
    margin-top: 40px;
    background-color: #2c3e50;
    color: #fff;
}

.footer-top {
    background-color: #2c3e50;
}

.footer-bottom {
    background-color: #1a252f;
    padding: 15px 0;
    text-align: center;
}

.footer-title {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    position: relative;
}

.footer-title:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 2px;
    background-color: var(--primary-color);
}

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

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.3s ease;
    display: block;
}

.footer-links a:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

.footer-social {
    display: flex;
    gap: 10px;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    transition: all 0.3s ease;
}

.social-icon:hover {
    background-color: var(--primary-color);
    color: #fff;
    transform: translateY(-3px);
}

.contact-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
}

.contact-item i {
    font-size: 18px;
    color: var(--primary-color);
    margin-right: 15px;
    margin-top: 5px;
}

.contact-item h4 {
    font-size: 14px;
    margin: 0 0 5px;
    color: #bdc3c7;
}

.contact-item p {
    margin: 0;
    color: #fff;
}

.copyright {
    color: #bdc3c7;
    font-size: 14px;
}

/* 响应式样式 */
@media (max-width: 1200px) {
    .container {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .site-branding,
    .main-navigation {
        float: none;
        text-align: center;
    }
    
    .main-navigation li {
        float: none;
        display: inline-block;
        margin: 0 10px;
    }
}

@media (max-width: 480px) {
    .main-navigation li {
        display: block;
        margin: 5px 0;
    }
}

/* WordPress必需样式 */
.wp-caption {
    max-width: 100%;
    padding: 4px;
}
.wp-caption-text {
    font-style: italic;
    color: #757575;
}
.sticky {
    background: #f7f7f7;
    padding: 10px;
}
.gallery-caption {
    font-size: 90%;
}
.bypostauthor {
    font-weight: bold;
}
.alignright {
    float: right;
    margin: 0 0 1em 1em;
}
.alignleft {
    float: left;
    margin: 0 1em 1em 0;
}
.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* ===== OS Download 单页美化与全局字体缩小 ===== */
html { font-size: 15px; }
body { font-size: 0.933rem; }

/* 前台兜底按钮样式，不依赖 Bootstrap */
.btn-primary { background-color: #0d6efd; color: #fff; }
.btn-warning { background-color: #f59f00; color: #fff; }
.download-button {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 6px;
  text-decoration: none;
  background: #eef1f5;
  color: #333;
  border: 1px solid #dfe3e8;
}
.download-button:hover { filter: brightness(0.95); }

/* 单页卡片与版式 */
.os-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,.06);
  padding: 20px;
  margin-bottom: 20px;
}
.os-header .entry-title { font-size: 1.75rem; margin: 0 0 8px; }
.os-meta { font-size: .92rem; color: #666; }
.os-meta .version, .os-meta .size, .os-meta .date { margin-right: 10px; }
.os-featured img { width: 100%; height: auto; border-radius: 8px; }
.os-content { font-size: 1rem; }
.os-content p { margin: 0 0 1rem; }
.os-content h2, .os-content h3, .os-content h4 { margin: 1.2rem 0 .6rem; line-height: 1.25; }
.os-content ul, .os-content ol { padding-left: 1.2rem; }
.os-content blockquote { padding: .8rem 1rem; margin: 1rem 0; background: #f9fbfd; border-left: 4px solid #c5d9f5; border-radius: 6px; }
.os-content pre, .os-content code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
.os-content pre { background: #111827; color: #e5e7eb; padding: 12px; border-radius: 8px; overflow: auto; }
.os-content table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.os-content table th, .os-content table td { border: 1px solid #e5e7eb; padding: .6rem .75rem; }
.os-content img { border-radius: 6px; }

/* 下载区提示 */
.os-callout { background: #f7fbff; border: 1px solid #d6e9ff; border-radius: 10px; padding: 16px; }
.os-callout.is-vip { background: #f6ffed; border-color: #b7eb8f; }

/* VIP徽章仅限下载单页内样式 */
.os-download-single .vip-badge {
  display: inline-block;
  font-size: .85rem;
  background: #fff7e6;
  color: #ad6800;
  border: 1px solid #ffd591;
  border-radius: 999px;
  padding: 4px 8px;
  margin-left: 8px;
}

/* 侧栏小部件微调 */
.sidebar-widget { margin-bottom: 20px; }
.sidebar-widget h3 { font-size: 1.1rem; }

/* ===== 文章页（single.php）内容美化 ===== */
.card-title.h3 { font-size: 1.5rem; }
.post-featured img { border-radius: 10px; }
.prose { font-size: 1rem; color: #333; }
.prose p { margin: 0 0 1rem; }
.prose h1 { font-size: 1.75rem; margin: 1.2rem 0 .6rem; }
.prose h2 { font-size: 1.5rem; margin: 1.2rem 0 .6rem; }
.prose h3 { font-size: 1.25rem; margin: 1rem 0 .5rem; }
.prose h4 { font-size: 1.1rem; margin: .8rem 0 .4rem; }
.prose ul, .prose ol { padding-left: 1.2rem; }
.prose blockquote { padding: .8rem 1rem; margin: 1rem 0; background: #f9fbfd; border-left: 4px solid #c5d9f5; border-radius: 6px; }
.prose pre, .prose code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
.prose pre { background: #111827; color: #e5e7eb; padding: 12px; border-radius: 8px; overflow: auto; }
.prose table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.prose table th, .prose table td { border: 1px solid #e5e7eb; padding: .6rem .75rem; }
.prose img { border-radius: 6px; }
.prose a { text-decoration: none; border-bottom: 1px dashed #cfe0ff; }
.prose a:hover { border-bottom-color: #8fb7ff; }

/* ===== 文章页整体卡片与导航美化 ===== */
.article-card { border: 1px solid #eceff4; border-radius: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.06); }
.article-header { border-bottom: 1px dashed #e9edf3; padding-bottom: .5rem; }
.article-title { font-size: 1.75rem; line-height: 1.3; }
.article-meta span { display: inline-flex; align-items: center; gap: 6px; margin-right: 16px; color: #6b7280; }
.article-featured img { border-radius: 12px; }
.article-content { font-size: 1rem; }
.article-divider { height: 1px; background: #eef2f7; }
.article-nav a { display: inline-flex; align-items: center; gap: 6px; background: #f3f6fb; color: #334155; border: 1px solid #e6ebf2; padding: 8px 12px; border-radius: 8px; text-decoration: none; }
.article-nav a:hover { background: #e9eff7; }