/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #86C8BC;
    --primary-light: #CEEDC7;
    --bg-color: #F8FAF9;
    --card-bg: #FFFFFF;
    --text-primary: #33373A;
    --text-secondary: #86909C;
    --border-color: #F0F2F5;
    --radius: 16px;
    --shadow: 0 2px 12px rgba(134, 200, 188, 0.08);
    --shadow-hover: 0 4px 20px rgba(134, 200, 188, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
}

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

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

img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
}

ul, ol {
    list-style: none;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部 */
.header {
    background: var(--card-bg);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 12px 0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* 移动端头部居中 */
@media (max-width: 768px) {
    .header-content {
        justify-content: center;
    }
    .header .nav, .header .search-box {
        display: none;
    }
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 600;
}

.logo img {
    height: 40px;
    width: auto;
    border-radius: 8px;
}

.nav {
    display: flex;
    gap: 24px;
}

.nav a {
    font-size: 16px;
    padding: 8px 0;
    position: relative;
}

.nav a.active {
    color: var(--primary-color);
}

.nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-color);
    border-radius: 20px;
    padding: 8px 16px;
    gap: 8px;
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    width: 180px;
    font-size: 14px;
}

.search-box button {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
}

/* 卡片通用样式 */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* 分类标签 */
.category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.tag {
    padding: 6px 16px;
    background: var(--bg-color);
    border-radius: 20px;
    font-size: 14px;
    color: var(--text-secondary);
    transition: all 0.3s;
}

.tag.active, .tag:hover {
    background: var(--primary-color);
    color: white;
}

/* 工具箱 */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.tool-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 12px;
    border-radius: var(--radius);
    background: var(--card-bg);
    box-shadow: var(--shadow);
    transition: all 0.3s;
    cursor: pointer;
}

.tool-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.tool-item img {
    width: 56px;
    height: 56px;
    border-radius: 12px;
}

.tool-item span {
    font-size: 14px;
    text-align: center;
}

/* 文章列表 */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 768px) {
    .articles-grid {
        grid-template-columns: 1fr;
    }
}

.article-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-radius: var(--radius);
    background: var(--card-bg);
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.article-item:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.article-thumb {
    width: 160px;
    height: 120px;
    flex-shrink: 0;
    border-radius: 12px;
    object-fit: cover;
}

@media (max-width: 768px) {
    .article-thumb {
        width: 120px;
        height: 90px;
    }
}

.article-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.article-title {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-meta {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    gap: 12px;
}

/* 文章区域布局 */
.content-wrap {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}
.main-content {
    min-width: 0;
}
.sidebar {
    min-width: 0;
}
/* 温馨提示模块 */
.tip-card {
    background: linear-gradient(135deg, #F0F9F6 0%, #F8FAF9 100%);
    border: 1px solid #CEEDC7 !important;
}
.tip-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tip-content {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
    margin: 0;
}
.tip-content strong {
    color: var(--text-primary);
}
/* 统计卡片 */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 0 20px;
}
.stat-card {
    background: white;
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
}
.stat-num {
    font-size: 32px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
}
.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
}
/* 快捷操作 */
.quick-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
    border-radius: var(--radius);
    background: var(--bg-color);
    transition: all 0.3s;
}
.quick-item:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
}
/* 后台logo */
.admin-logo {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}
.admin-logo img {
    height: 36px;
}
/* 热门文章 */
.hot-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hot-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 12px;
    transition: background 0.3s;
}

.hot-item:hover {
    background: var(--bg-color);
}

.hot-num {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: var(--primary-light);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.hot-item:nth-child(1) .hot-num,
.hot-item:nth-child(2) .hot-num,
.hot-item:nth-child(3) .hot-num {
    background: #FF6B6B;
    color: white;
}

.hot-title {
    font-size: 14px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hot-views {
    font-size: 12px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

/* 文章详情页 */
.article-detail {
    max-width: 800px;
    margin: 0 auto;
}

.article-header {
    text-align: center;
    margin-bottom: 24px;
}

.article-header h1 {
    font-size: 28px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 16px;
}

.article-meta-detail {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    justify-content: center;
    gap: 20px;
}

.article-content {
    font-size: 17px;
    line-height: 1.8;
    margin-bottom: 32px;
}

.article-content p {
    margin-bottom: 20px;
}

.article-content img {
    margin: 20px 0;
    width: 100%;
}

.article-content h2, .article-content h3 {
    margin: 30px 0 16px;
    font-weight: 600;
}

.article-content h2 {
    font-size: 22px;
}

.article-content h3 {
    font-size: 19px;
}

/* 版权声明模块 */
.copyright-card {
    background: linear-gradient(135deg, #F6FFF9 0%, #F0FBF8 100%);
    border: 1px solid var(--primary-light);
    border-radius: var(--radius);
    padding: 24px;
    margin: 32px 0;
}

.copyright-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.copyright-content {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.copyright-content p {
    margin-bottom: 8px;
}

/* 广告位 */
.ad-slot {
    margin: 20px 0;
    text-align: center;
    border-radius: var(--radius);
    overflow: hidden;
    min-height: 10px;
}

.ad-slot ins, .ad-slot iframe, .ad-slot img {
    max-width: 100%;
    border-radius: var(--radius);
}

/* 底部 */
.footer {
    background: var(--card-bg);
    padding: 30px 0;
    margin-top: 40px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

.footer p {
    margin-bottom: 8px;
}

.footer a {
    color: var(--text-secondary);
    margin: 0 8px;
}

.footer a:hover {
    color: var(--primary-color);
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: 12px;
    border: none;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #72b8aa;
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* 表单 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.3s;
}

.form-input:focus {
    border-color: var(--primary-color);
}

textarea.form-input {
    min-height: 120px;
    resize: vertical;
}

/* 后台样式 */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 240px;
    background: var(--card-bg);
    box-shadow: var(--shadow);
    padding: 20px 0;
    flex-shrink: 0;
}

.admin-sidebar .logo {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.admin-menu {
    display: flex;
    flex-direction: column;
}

.admin-menu a {
    padding: 12px 20px;
    font-size: 15px;
    transition: all 0.3s;
}

.admin-menu a:hover, .admin-menu a.active {
    background: var(--bg-color);
    color: var(--primary-color);
    border-left: 3px solid var(--primary-color);
}

.admin-main {
    flex: 1;
    padding: 24px;
    background: var(--bg-color);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.admin-table {
    width: 100%;
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.admin-table th, .admin-table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.admin-table th {
    background: var(--bg-color);
    font-weight: 600;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* 登录页 */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
}

.login-title {
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 30px;
}

/* 安装页 */
.install-container {
    max-width: 600px;
    margin: 50px auto;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow);
}

.install-title {
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 30px;
}

/* 头部操作按钮 */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.dark-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--bg-color);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}
.dark-toggle:hover {
    background: var(--primary-light);
    transform: scale(1.05);
}
/* 更多按钮 */
.more-btn {
    font-size: 14px;
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--primary-light);
    transition: all 0.3s;
}
.more-btn:hover {
    background: var(--primary-color);
    color: white;
}
/* 工具列表页 */
.page-header {
    margin-bottom: 24px;
}
.page-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}
.page-header p {
    color: var(--text-secondary);
    font-size: 14px;
}
.tool-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
@media (max-width: 768px) {
    .tool-list {
        grid-template-columns: 1fr;
    }
}
.tool-list .tool-item {
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
}
.tool-list .tool-item img {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}
.tool-list .tool-info {
    flex: 1;
}
.tool-list .tool-name {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 6px;
}
.tool-list .tool-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}
/* 工具详情页 */
.tool-content {
    padding: 20px 0;
}
/* 暗黑模式 护眼模式 */
.dark-mode {
    --primary-color: #86C8BC;
    --primary-light: #2d4a44;
    --bg-color: #1a1d1f;
    --card-bg: #262a2d;
    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    --border-color: #374151;
    --shadow: 0 2px 12px rgba(0,0,0,0.3);
    --shadow-hover: 0 4px 20px rgba(0,0,0,0.4);
}
.dark-mode body {
    background-color: var(--bg-color);
    color: var(--text-primary);
}
.dark-mode .header {
    background: var(--card-bg);
}
.dark-mode .search-box {
    background: var(--bg-color);
}
.dark-mode .dark-toggle {
    background: var(--bg-color);
}
.dark-mode .dark-toggle:hover {
    background: var(--primary-light);
}
.dark-mode .tip-card {
    background: linear-gradient(135deg, #20332f 0%, #1a1d1f 100%) !important;
    border-color: var(--primary-light) !important;
}
.dark-mode .copyright-card {
    background: linear-gradient(135deg, #20332f 0%, #1e2b28 100%);
    border-color: var(--primary-light);
}
.dark-mode .footer {
    background: var(--card-bg);
}
.dark-mode .tag {
    background: var(--bg-color);
    color: var(--text-secondary);
}
.dark-mode .tag.active, .dark-mode .tag:hover {
    background: var(--primary-color);
    color: white;
}
.dark-mode .hot-item:hover {
    background: var(--bg-color);
}
.dark-mode .hot-num {
    background: var(--primary-light);
    color: var(--primary-color);
}
.dark-mode .btn-outline {
    border-color: var(--primary-color);
    color: var(--primary-color);
}
.dark-mode .form-input {
    background: var(--bg-color);
    border-color: var(--border-color);
    color: var(--text-primary);
}
.dark-mode .admin-sidebar {
    background: var(--card-bg);
}
.dark-mode .admin-menu a:hover, .dark-mode .admin-menu a.active {
    background: var(--bg-color);
}
.dark-mode .admin-table {
    background: var(--card-bg);
}
.dark-mode .admin-table th {
    background: var(--bg-color);
}
.dark-mode .admin-table th, .dark-mode .admin-table td {
    border-color: var(--border-color);
}
.dark-mode .login-container, .dark-mode .install-container {
    background: var(--card-bg);
}
.dark-mode .quick-item {
    background: var(--bg-color);
}
.dark-mode .quick-item:hover {
    background: var(--primary-light);
}
.dark-mode .more-btn {
    background: var(--primary-light);
    color: var(--primary-color);
}
.dark-mode .more-btn:hover {
    background: var(--primary-color);
    color: white;
}
/* 后台UI优化 */
.admin-main {
    background: var(--bg-color);
}
.admin-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}
.admin-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
/* 手机端后台菜单优化 所有功能显示 不横向滚动 */
@media (max-width: 768px) {
    .admin-sidebar {
        padding: 12px 0;
    }
    .admin-sidebar .logo {
        padding: 0 16px 12px;
        margin-bottom: 12px;
    }
    .admin-menu {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        padding: 0 12px;
        overflow-x: visible;
    }
    .admin-menu a {
        padding: 8px 14px;
        border-radius: 20px;
        background: var(--bg-color);
        font-size: 14px;
        border: none !important;
    }
    .admin-menu a:hover, .admin-menu a.active {
        background: var(--primary-color);
        color: white !important;
        border: none !important;
    }
    .admin-main {
        padding: 16px;
    }
    .nav {
        display: none;
    }
    .header-content {
        justify-content: space-between;
    }
}
/* 响应式调整 */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .article-item {
        padding: 12px;
    }
    
    .article-header h1 {
        font-size: 22px;
    }
    
    .article-content {
        font-size: 16px;
    }
    
    .admin-layout {
        flex-direction: column;
    }
    
    /* 手机端文章区域单列，热门文章放最上面 */
    .content-wrap {
        grid-template-columns: 1fr;
    }
    .content-wrap .sidebar {
        order: -1;
    }
    /* 手机端统计卡片2列 */
    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
        padding: 0;
        gap: 12px;
    }
    .stat-card {
        padding: 16px;
    }
    .stat-num {
        font-size: 24px;
    }
    /* 手机端文章列表1列 */
    .articles-grid {
        grid-template-columns: 1fr;
    }
    /* 手机端文章元信息换行 */
    .article-meta-detail {
        flex-wrap: wrap;
        gap: 10px;
    }
}
