/*
Theme Name: Roco Kingdom Wiki Pro
Theme URI: https://example.com/
Description: 洛克王国精灵图鉴专业版 - 大厂风格设计，支持高级自定义
Version: 2.0.0
Author: RocoKingdom
Author URI: https://example.com/
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: roco-wiki
Tags: roco kingdom, pokemon, game, wiki, square cards, light theme
*/

/* CSS Reset & Variables */
:root {
    --color-primary: #1890ff;
    --color-primary-hover: #40a9ff;
    --color-success: #52c41a;
    --color-warning: #faad14;
    --color-error: #ff4d4f;
    --color-text-primary: #262626;
    --color-text-secondary: #8c8c8c;
    --color-text-tertiary: #bfbfbf;
    --color-border: #d9d9d9;
    --color-border-light: #f0f0f0;
    --color-bg: #f5f5f5;
    --color-bg-white: #ffffff;
    --color-bg-gray: #fafafa;
    --color-bg-dark: #1f1f1f;
    --color-fire: #ff7a45;
    --color-water: #1890ff;
    --color-grass: #52c41a;
    --color-electric: #faad14;
    --color-psychic: #eb2f96;
    --color-ice: #36cfc9;
    --color-dragon: #722ed1;
    --color-dark: #595959;
    --color-fairy: #ff85c0;
    --color-fighting: #fa541c;
    --color-flying: #b37feb;
    --color-poison: #722ed1;
    --color-ground: #d48806;
    --color-rock: #8c8c8c;
    --color-bug: #a0d911;
    --color-ghost: #722ed1;
    --color-steel: #d9d9d9;
    --color-light: #faad14;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--color-bg);
    color: var(--color-text-primary);
    line-height: 1.6;
    font-size: 14px;
}

/* Header */
.site-header {
    background: var(--color-bg-white);
    border-bottom: 1px solid var(--color-border-light);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.site-header .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-title img {
    height: 36px;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 32px;
}

.main-nav a {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
    position: relative;
    padding-bottom: 4px;
}

.main-nav a:hover,
.main-nav a.current-menu-item {
    color: var(--color-primary);
}

.main-nav a.current-menu-item::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--color-primary);
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.page-title {
    margin-bottom: 24px;
}

.page-title h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
}

.page-title p {
    color: var(--color-text-secondary);
    font-size: 14px;
}

/* Filter Section */
.filter-section {
    background: var(--color-bg-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.filter-group {
    margin-bottom: 16px;
}

.filter-group:last-of-type {
    margin-bottom: 0;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border-light);
}

.filter-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-primary);
    margin-bottom: 12px;
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-tag {
    padding: 6px 16px;
    background: var(--color-bg-gray);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--color-text-secondary);
    font-size: 14px;
    font-weight: 400;
}

.filter-tag:hover {
    background: var(--color-bg-white);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.filter-tag.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.search-box {
    display: flex;
    gap: 12px;
    max-width: 400px;
    margin-top: 16px;
}

.search-box input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg-white);
    color: var(--color-text-primary);
    font-size: 14px;
    transition: all var(--transition-fast);
}

.search-box input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
}

.search-box button {
    padding: 10px 24px;
    background: var(--color-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.search-box button:hover {
    background: var(--color-primary-hover);
}

/* Pokemon Grid */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.post-card {
    background: var(--color-bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.post-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.post-image {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(135deg, var(--color-bg-gray), var(--color-bg-white));
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 16px;
}

.post-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform var(--transition-normal);
}

.post-card:hover .post-image img {
    transform: scale(1.05);
}

.post-number {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.45);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: white;
    font-weight: 500;
}

.post-name {
    padding: 12px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Detail Page - Wiki Style */
.detail-wrapper {
    background: var(--color-bg-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.detail-header {
    background: linear-gradient(135deg, #f0f7ff, #e6f7ff);
    padding: 32px;
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.detail-image-wrapper {
    flex-shrink: 0;
}

.detail-image {
    width: 200px;
    height: 200px;
    background: var(--color-bg-white);
    border-radius: var(--radius-lg);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-md);
}

.detail-image img {
    max-width: 160px;
    max-height: 160px;
    object-fit: contain;
}

.detail-info-header {
    flex: 1;
}

.detail-name-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 16px;
}

.detail-name-row h1 {
    font-size: 32px;
    font-weight: 600;
}

.detail-number {
    font-size: 16px;
    color: var(--color-text-secondary);
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.type-tag {
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: white;
}

.type-normal { background: var(--color-text-secondary); }
.type-fire { background: var(--color-fire); }
.type-water { background: var(--color-water); }
.type-grass { background: var(--color-grass); }
.type-electric { background: var(--color-electric); }
.type-psychic { background: var(--color-psychic); }
.type-ice { background: var(--color-ice); }
.type-dragon { background: var(--color-dragon); }
.type-dark { background: var(--color-dark); }
.type-fairy { background: var(--color-fairy); }
.type-fighting { background: var(--color-fighting); }
.type-flying { background: var(--color-flying); }
.type-poison { background: var(--color-poison); }
.type-ground { background: var(--color-ground); }
.type-rock { background: var(--color-rock); }
.type-bug { background: var(--color-bug); }
.type-ghost { background: var(--color-ghost); }
.type-steel { background: var(--color-steel); }
.type-light { background: var(--color-light); }

.detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.detail-meta-item {
    background: var(--color-bg-white);
    padding: 12px 16px;
    border-radius: var(--radius-md);
}

.detail-meta-label {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-bottom: 4px;
}

.detail-meta-value {
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text-primary);
}

.detail-body {
    padding: 32px;
}

.detail-section {
    margin-bottom: 32px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--color-primary);
    display: inline-block;
}

/* Stats - Hexagon Style */
.stats-wrapper {
    display: flex;
    gap: 48px;
    align-items: center;
}

.stats-chart {
    flex-shrink: 0;
    width: 300px;
    height: 300px;
}

.stats-list {
    flex: 1;
}

.stat-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.stat-label {
    width: 80px;
    font-size: 14px;
    color: var(--color-text-secondary);
}

.stat-bar-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-bar {
    flex: 1;
    height: 12px;
    background: var(--color-bg-gray);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-hover));
    border-radius: var(--radius-sm);
    transition: width 0.5s ease;
}

.stat-value {
    width: 50px;
    text-align: right;
    font-weight: 600;
    font-size: 14px;
}

/* Abilities */
.abilities-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.ability-item {
    background: var(--color-bg-gray);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    border-left: 3px solid var(--color-primary);
}

.ability-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.ability-desc {
    font-size: 13px;
    color: var(--color-text-secondary);
}

/* Evolution Chain */
.evolution-chain {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--color-bg-gray);
    border-radius: var(--radius-lg);
}

.evo-stage {
    text-align: center;
    background: var(--color-bg-white);
    padding: 16px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.evo-stage img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 8px;
}

.evo-stage h4 {
    font-size: 14px;
    font-weight: 600;
}

.evo-arrow {
    font-size: 24px;
    color: var(--color-text-tertiary);
}

/* Skills Table */
.skills-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-bg-white);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.skills-table thead {
    background: var(--color-bg-gray);
}

.skills-table th,
.skills-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--color-border-light);
}

.skills-table th {
    font-weight: 600;
    font-size: 13px;
    color: var(--color-text-secondary);
    text-transform: uppercase;
}

.skills-table td {
    font-size: 14px;
}

.skill-name-cell {
    font-weight: 600;
}

/* Description */
.detail-description {
    line-height: 1.8;
    color: var(--color-text-primary);
    font-size: 15px;
    padding: 20px;
    background: var(--color-bg-gray);
    border-radius: var(--radius-md);
}

/* Footer */
.site-footer {
    background: var(--color-bg-white);
    padding: 32px;
    margin-top: 48px;
    text-align: center;
    color: var(--color-text-secondary);
    border-top: 1px solid var(--color-border-light);
}

/* Navigation */
.navigation {
    text-align: center;
    margin-top: 24px;
}

.navigation a {
    display: inline-block;
    padding: 10px 24px;
    background: var(--color-bg-white);
    color: var(--color-text-primary);
    text-decoration: none;
    border-radius: var(--radius-md);
    margin: 0 8px;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.navigation a:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-2px);
}

.no-results {
    text-align: center;
    padding: 48px;
    color: var(--color-text-secondary);
    font-size: 15px;
}

/* Admin Settings */
.roco-settings-wrap {
    max-width: 800px;
    margin: 24px 0;
}

.roco-settings-header {
    background: var(--color-bg-white);
    padding: 24px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border: 1px solid var(--color-border-light);
    border-bottom: none;
}

.roco-settings-header h1 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 8px;
}

.roco-settings-form {
    background: var(--color-bg-white);
    padding: 24px;
    border: 1px solid var(--color-border-light);
}

.roco-settings-section {
    margin-bottom: 32px;
}

.roco-settings-section h2 {
    font-size: 16px;
    font-weight: 600;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border-light);
    margin-bottom: 20px;
}

.roco-settings-row {
    margin-bottom: 20px;
}

.roco-settings-row label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--color-text-primary);
}

.roco-settings-row input[type="text"],
.roco-settings-row textarea,
.roco-settings-row select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: all var(--transition-fast);
}

.roco-settings-row input:focus,
.roco-settings-row textarea:focus,
.roco-settings-row select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
}

.roco-settings-row textarea {
    min-height: 100px;
}

.roco-settings-submit {
    padding-top: 20px;
    border-top: 1px solid var(--color-border-light);
}

.roco-settings-submit .button-primary {
    padding: 10px 32px;
    font-size: 14px;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .site-header .container {
        padding: 0 16px;
        height: auto;
        flex-direction: column;
        gap: 12px;
        padding: 12px 16px;
    }
    
    .main-nav ul {
        gap: 16px;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .post-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
    }
    
    .detail-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .detail-meta-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-wrapper {
        flex-direction: column;
    }
    
    .skills-table {
        display: block;
        overflow-x: auto;
    }
    
    .evolution-chain {
        flex-direction: column;
    }
}
