/* ============================================
   CraftWorld - 主样式表
   高级感设计系统
   ============================================ */

:root {
    /* 主题色 */
    --mc-green: #4caf50;
    --mc-green-dark: #2e7d32;
    --mc-green-light: #81c784;
    --mc-grass: #7cb342;
    --mc-diamond: #4dd0e1;
    --mc-gold: #ffd54f;
    --mc-redstone: #ef5350;
    --mc-emerald: #2e7d32;

    /* 暗色系 */
    --bg-primary: #0a0e14;
    --bg-secondary: #11161f;
    --bg-tertiary: #1a2030;
    --bg-card: rgba(20, 26, 38, 0.7);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --bg-glass-hover: rgba(255, 255, 255, 0.08);

    /* 文字 */
    --text-primary: #e8edf5;
    --text-secondary: #9ba8bd;
    --text-muted: #6b7689;

    /* 边框 */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.16);

    /* 渐变 */
    --gradient-primary: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
    --gradient-diamond: linear-gradient(135deg, #4dd0e1 0%, #26c6da 100%);
    --gradient-gold: linear-gradient(135deg, #ffd54f 0%, #ff8f00 100%);
    --gradient-purple: linear-gradient(135deg, #7c4dff 0%, #5e35b1 100%);
    --gradient-sunset: linear-gradient(135deg, #ff6b6b 0%, #ee0979 100%);

    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(76, 175, 80, 0.3);

    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    /* 过渡 */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
    color: var(--mc-green-light);
}

img {
    max-width: 100%;
    display: block;
}

code {
    font-family: "SF Mono", "Fira Code", Consolas, monospace;
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--mc-diamond);
}

/* ============================================
   布局
   ============================================ */
.app-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
}

/* ============================================
   顶部导航
   ============================================ */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 14, 20, 0.6);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.site-header.scrolled {
    background: rgba(10, 14, 20, 0.85);
    box-shadow: var(--shadow-md);
}

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

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

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
    transition: var(--transition);
}

.logo:hover .logo-icon {
    transform: rotate(-8deg) scale(1.05);
}

.main-nav {
    display: flex;
    gap: 8px;
    flex: 1;
    justify-content: center;
}

.nav-link {
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-glass);
}

.nav-link.active {
    color: var(--mc-green-light);
    background: rgba(76, 175, 80, 0.1);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.server-status-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-dot.online {
    background: var(--mc-green);
    box-shadow: 0 0 8px var(--mc-green);
    animation: pulse 2s infinite;
}

.status-dot.offline {
    background: var(--mc-redstone);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================
   按钮
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    white-space: nowrap;
}

.btn-sm {
    padding: 8px 18px;
    font-size: 13px;
}

.btn-lg {
    padding: 16px 36px;
    font-size: 17px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(76, 175, 80, 0.5);
    color: #fff;
}

.btn-ghost {
    background: var(--bg-glass);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-ghost:hover {
    background: var(--bg-glass-hover);
    border-color: var(--border-hover);
}

.btn-diamond {
    background: var(--gradient-diamond);
    color: #003c40;
    box-shadow: 0 4px 16px rgba(77, 208, 225, 0.3);
}

.btn-gold {
    background: var(--gradient-gold);
    color: #3e2723;
}

.btn-danger {
    background: var(--mc-redstone);
    color: #fff;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   用户菜单
   ============================================ */
.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px 6px 6px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    cursor: pointer;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.user-menu-btn:hover {
    background: var(--bg-glass-hover);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--mc-green);
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: var(--transition);
    z-index: 100;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: block;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
}

.user-dropdown a:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

.logout-link:hover {
    color: var(--mc-redstone) !important;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

/* ============================================
   苹果风格 Modal 弹窗
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.apple-modal {
    background: linear-gradient(180deg, rgba(30, 36, 50, 0.95), rgba(20, 26, 38, 0.95));
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px 36px 32px;
    max-width: 380px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9) translateY(20px);
    transition: var(--transition-slow);
}

.modal-overlay.show .apple-modal {
    transform: scale(1) translateY(0);
}

.modal-emoji {
    font-size: 64px;
    line-height: 1;
    margin-bottom: 20px;
    animation: modalEmojiBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalEmojiBounce {
    0% { transform: scale(0) rotate(-30deg); opacity: 0; }
    60% { transform: scale(1.2) rotate(8deg); }
    100% { transform: scale(1) rotate(0); opacity: 1; }
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.modal-message {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 28px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-actions .btn {
    flex: 1;
    padding: 12px 20px;
    font-size: 15px;
}

/* ============================================
   Toast 提示
   ============================================ */
.toast-container {
    position: fixed;
    top: 90px;
    right: 24px;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--mc-green);
    border-radius: var(--radius-sm);
    padding: 14px 20px;
    min-width: 280px;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(120%);
    transition: var(--transition);
    pointer-events: auto;
}

.toast.show {
    transform: translateX(0);
}

.toast.success { border-left-color: var(--mc-green); }
.toast.error { border-left-color: var(--mc-redstone); }
.toast.warning { border-left-color: var(--mc-gold); }
.toast.info { border-left-color: var(--mc-diamond); }

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
    font-size: 14px;
}

/* ============================================
   通用容器
   ============================================ */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
}

.page-wrap {
    padding-top: 70px;
    min-height: 100vh;
}

.section {
    padding: 80px 0;
}

.section-title {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #fff 0%, #9ba8bd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    color: var(--text-secondary);
    font-size: 17px;
    margin-bottom: 48px;
}

/* ============================================
   卡片
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: var(--transition);
}

.card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    transition: var(--transition);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--mc-green);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15);
    background: var(--bg-secondary);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    min-height: 140px;
    resize: vertical;
    line-height: 1.6;
}

.form-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 6px;
}

.form-error {
    color: var(--mc-redstone);
    font-size: 13px;
    margin-top: 6px;
}

/* ============================================
   角色徽章
   ============================================ */
.role-badge,
.vip-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 4px;
}

.role-admin {
    background: rgba(239, 83, 80, 0.15);
    color: var(--mc-redstone);
}

.role-mod {
    background: rgba(77, 208, 225, 0.15);
    color: var(--mc-diamond);
}

.role-member {
    background: rgba(155, 168, 189, 0.15);
    color: var(--text-secondary);
}

.vip-1 { background: rgba(205, 127, 50, 0.15); color: #cd7f32; }
.vip-2 { background: rgba(192, 192, 192, 0.15); color: #c0c0c0; }
.vip-3 { background: rgba(255, 215, 0, 0.15); color: var(--mc-gold); }
.vip-4 { background: rgba(77, 208, 225, 0.15); color: var(--mc-diamond); }

/* ============================================
   分页
   ============================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.page-link {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.page-link:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
}

.page-link.active {
    background: var(--gradient-primary);
    color: #fff;
    border-color: transparent;
}

.page-ellipsis {
    color: var(--text-muted);
    padding: 0 8px;
}

/* ============================================
   页脚
   ============================================ */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 60px 0 30px;
    margin-top: 80px;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 40px;
}

.footer-brand .logo {
    margin-bottom: 16px;
}

.footer-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 12px;
    max-width: 320px;
}

.footer-server {
    color: var(--text-muted);
    font-size: 13px;
}

.footer-col h4 {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 18px;
    color: var(--text-primary);
}

.footer-col ul {
    list-style: none;
}

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

.footer-col a,
.footer-col li {
    color: var(--text-secondary);
    font-size: 14px;
    transition: var(--transition);
}

.footer-col a:hover {
    color: var(--mc-green-light);
}

.footer-bottom {
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

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

/* ============================================
   网格布局
   ============================================ */
.grid {
    display: grid;
    gap: 24px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ============================================
   空状态
   ============================================ */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 16px;
}

/* ============================================
   响应式
   ============================================ */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .header-inner {
        padding: 0 16px;
        gap: 16px;
    }
    .main-nav {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        flex-direction: column;
        padding: 20px;
        gap: 4px;
        border-bottom: 1px solid var(--border-color);
        transform: translateY(-150%);
        transition: var(--transition);
        box-shadow: var(--shadow-lg);
    }
    .main-nav.show {
        transform: translateY(0);
    }
    .nav-toggle {
        display: flex;
    }
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(4px, 4px);
    }
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(4px, -4px);
    }
    .server-status-mini {
        display: none;
    }
    .user-name {
        display: none;
    }
    .container {
        padding: 0 16px;
    }
    .section {
        padding: 48px 0;
    }
    .section-title {
        font-size: 28px;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
    .toast-container {
        right: 16px;
        left: 16px;
    }
    .toast {
        min-width: auto;
        max-width: none;
    }
}
