/* ============ 全局基础 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    /* 配色方案：深蓝紫渐变 + 青蓝/紫罗兰强调色 */
    --bg-primary: #0f1023;
    --bg-secondary: #171a3a;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.09);
    --text-primary: #eef0ff;
    --text-secondary: #9aa0c3;
    --accent: #6c8cff;
    --accent-2: #a78bfa;
    --accent-hover: #8aa5ff;
    --success: #34d399;
    --danger: #f87171;
    --warning: #fbbf24;
    --border: rgba(255, 255, 255, 0.1);
    --console-bg: rgba(10, 12, 30, 0.9);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    --radius: 14px;
    --transition: all 0.25s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: linear-gradient(160deg, #0f1023 0%, #1a1440 50%, #0f1023 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

/* ============ 导航栏 ============ */
.navbar {
    background: rgba(15, 16, 35, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}
.nav-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.5px;
}
.nav-logo:hover { opacity: 0.85; }
.nav-menu { list-style: none; display: flex; gap: 8px; align-items: center; }
.nav-menu li a {
    color: var(--text-secondary);
    font-size: 0.95rem;
    padding: 8px 14px;
    border-radius: 8px;
    transition: var(--transition);
}
.nav-menu li a:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}
.nav-menu li a.active {
    color: var(--text-primary);
    background: linear-gradient(135deg, rgba(108, 140, 255, 0.25), rgba(167, 139, 250, 0.25));
    border: 1px solid rgba(108, 140, 255, 0.35);
}
.nav-login, .nav-logout {
    padding: 8px 18px !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, var(--accent), var(--accent-2)) !important;
    color: #fff !important;
    font-weight: 600;
    border: none !important;
}
.nav-login:hover, .nav-logout:hover {
    background: linear-gradient(135deg, var(--accent-hover), #b8a6ff) !important;
    color: #fff !important;
}

/* ============ 主容器 ============ */
.container { max-width: 1100px; margin: 0 auto; padding: 40px 20px; flex: 1; width: 100%; }

/* ============ Flash 提示 ============ */
.flash {
    padding: 14px 20px;
    border-radius: 10px;
    margin-bottom: 24px;
    font-size: 0.95rem;
    backdrop-filter: blur(8px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    animation: flash-in 0.4s ease;
}
@keyframes flash-in {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}
.flash-hide { opacity: 0; transform: translateY(-10px); }
.flash-success { background: rgba(52, 211, 153, 0.12); border: 1px solid rgba(52, 211, 153, 0.4); color: #6ee7b7; }
.flash-error { background: rgba(248, 113, 113, 0.12); border: 1px solid rgba(248, 113, 113, 0.4); color: #fca5a5; }
.flash-info { background: rgba(108, 140, 255, 0.12); border: 1px solid rgba(108, 140, 255, 0.4); color: #a5b4fc; }

/* ============ Hero 首页头部 ============ */
.hero {
    text-align: center;
    padding: 70px 20px 50px;
    position: relative;
}
.hero::before {
    content: "";
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 300px;
    background: radial-gradient(ellipse, rgba(108, 140, 255, 0.18), transparent 70%);
    pointer-events: none;
    z-index: -1;
}
.hero h1 {
    font-size: 2.6rem;
    margin-bottom: 18px;
    background: linear-gradient(135deg, #8aa5ff, #a78bfa, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
}
.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto;
}

/* ============ 关于卡片 ============ */
.about-section { margin-top: 10px; }
.about-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px 34px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
}
.about-card h2 {
    font-size: 1.25rem;
    margin-bottom: 14px;
    color: var(--accent);
}
.about-card p {
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-size: 0.98rem;
}
.about-card p:last-child { margin-bottom: 0; }

/* ============ 菜单卡片 ============ */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 40px;
}
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 28px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    opacity: 0;
    transition: var(--transition);
}
.card:hover {
    transform: translateY(-6px);
    background: var(--bg-card-hover);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}
.card:hover::before { opacity: 1; }
.card-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 18px;
    background: linear-gradient(135deg, rgba(108, 140, 255, 0.2), rgba(167, 139, 250, 0.2));
    border: 1px solid rgba(108, 140, 255, 0.3);
}
.card h2 { font-size: 1.25rem; margin-bottom: 12px; }
.card p { color: var(--text-secondary); margin-bottom: 22px; font-size: 0.95rem; }

/* ============ 按钮 ============ */
.btn {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    backdrop-filter: blur(6px);
}
.btn:hover {
    background: var(--bg-card-hover);
    border-color: rgba(108, 140, 255, 0.4);
    color: var(--text-primary);
    transform: translateY(-2px);
}
.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-color: transparent;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(108, 140, 255, 0.3);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-hover), #b8a6ff);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 20px rgba(108, 140, 255, 0.45);
}
.btn-danger {
    background: linear-gradient(135deg, #f87171, #fb7185);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
}
.btn-danger:hover {
    background: linear-gradient(135deg, #ef4444, #f43f5e);
    border-color: transparent;
    color: #fff;
}
.btn-sm { padding: 6px 14px; font-size: 0.85rem; border-radius: 8px; }
.btn-full { width: 100%; }
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ============ 登录页 ============ */
.login-section { display: flex; justify-content: center; align-items: center; min-height: 65vh; }
.login-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 44px 40px;
    width: 100%;
    max-width: 420px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
}
.login-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    background: linear-gradient(135deg, rgba(108, 140, 255, 0.25), rgba(167, 139, 250, 0.25));
    border: 2px solid rgba(108, 140, 255, 0.4);
    box-shadow: 0 0 24px rgba(108, 140, 255, 0.2);
}
.login-box h1 {
    text-align: center;
    margin-bottom: 8px;
    font-size: 1.6rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.login-hint { text-align: center; color: var(--text-secondary); margin-bottom: 30px; font-size: 0.9rem; }

/* ============ 表单 ============ */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.form-group input[type="password"],
.form-group input[type="text"],
.form-group input[type="file"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(15, 16, 35, 0.6);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition);
}
.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(108, 140, 255, 0.15);
}
.form-group input[type="file"] { padding: 10px; cursor: pointer; }

/* ============ 页面头部 ============ */
.page-header { margin-bottom: 36px; }
.page-header h1 {
    font-size: 1.9rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.page-header p { color: var(--text-secondary); }

/* ============ 上传区 ============ */
.upload-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 30px;
    margin-bottom: 36px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
}
.upload-section h2 { font-size: 1.2rem; margin-bottom: 18px; }
.upload-form { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.upload-form .form-group { flex: 1; min-width: 250px; margin-bottom: 0; }
.upload-hint { margin-top: 14px; font-size: 0.85rem; color: var(--text-secondary); }

/* ============ 文件列表 ============ */
.file-list-section h2 { font-size: 1.2rem; margin-bottom: 18px; }
.file-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
}
.file-table th, .file-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.file-table th {
    background: rgba(108, 140, 255, 0.08);
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}
.file-table tr:last-child td { border-bottom: none; }
.file-table tr:hover td { background: rgba(255, 255, 255, 0.03); }
.file-name { font-weight: 500; color: var(--text-primary); }
.inline-form { display: inline; }
.empty-hint {
    color: var(--text-secondary);
    padding: 30px;
    text-align: center;
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

/* ============ MC 状态区 ============ */
.mc-status-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 36px;
}
@media (max-width: 768px) { .mc-status-section { grid-template-columns: 1fr; } }
.status-card, .info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 30px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
}
.status-card h2, .info-card h2 { font-size: 1.2rem; margin-bottom: 18px; }
.status-display { text-align: center; padding: 24px 0; }
.status-badge {
    display: inline-block;
    padding: 10px 30px;
    border-radius: 30px;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 1px;
}
.status-running {
    background: rgba(52, 211, 153, 0.15);
    color: #6ee7b7;
    border: 1px solid rgba(52, 211, 153, 0.5);
    box-shadow: 0 0 20px rgba(52, 211, 153, 0.2);
}
.status-stopped {
    background: rgba(248, 113, 113, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(248, 113, 113, 0.5);
    box-shadow: 0 0 20px rgba(248, 113, 113, 0.15);
}
.status-pid { margin-top: 12px; color: var(--text-secondary); font-size: 0.9rem; }
.mc-actions { display: flex; gap: 12px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.info-list { list-style: none; }
.info-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.92rem;
    color: var(--text-secondary);
}
.info-list li:last-child { border-bottom: none; }
.info-list strong { color: var(--text-primary); }
.info-list code {
    background: rgba(15, 16, 35, 0.7);
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    word-break: break-all;
    color: var(--accent);
}

/* ============ MC 在线玩家 ============ */
.mc-players-section {
    margin-bottom: 36px;
    padding: 24px 30px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.players-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.players-header h2 { font-size: 1.2rem; }
.players-header span { color: var(--accent); font-weight: 600; }
.player-row { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.player-row:last-child { border-bottom: none; }
.player-role { font-weight: 600; }
.player-operator { color: var(--warning); }
.player-member { color: var(--text-secondary); }
.players-empty { color: var(--text-secondary); padding: 8px 0; }

/* ============ MC 控制台 ============ */
.mc-console-section h2 { font-size: 1.2rem; margin-bottom: 18px; }
.console-box {
    background: var(--console-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    height: 420px;
    overflow-y: auto;
    box-shadow: var(--shadow);
}
.console-box pre {
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 0.85rem;
    color: #b8bdd8;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.6;
}
.console-command-form {
    margin-top: 18px;
}
.console-command-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-size: 0.92rem;
    font-weight: 600;
}
.console-command-row {
    display: flex;
    gap: 12px;
}
.console-command-row input {
    flex: 1;
    min-width: 0;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: rgba(10, 12, 30, 0.75);
    color: var(--text-primary);
    font: inherit;
}
.console-command-row input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(108, 140, 255, 0.15);
}
@media (max-width: 600px) {
    .console-command-row { flex-direction: column; }
    .console-command-row .btn { width: 100%; }
}
.console-hint { margin-top: 12px; font-size: 0.85rem; color: var(--text-secondary); }

/* ============ QQ 页 ============ */
.qq-section { display: flex; justify-content: center; }
.qq-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 50px 40px;
    width: 100%;
    max-width: 520px;
    text-align: center;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
}
.qq-avatar {
    width: 84px;
    height: 84px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.6rem;
    background: linear-gradient(135deg, rgba(108, 140, 255, 0.25), rgba(167, 139, 250, 0.25));
    border: 2px solid rgba(108, 140, 255, 0.4);
    box-shadow: 0 0 30px rgba(108, 140, 255, 0.2);
}
.qq-card h2 {
    font-size: 1.5rem;
    margin-bottom: 14px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.qq-card p { color: var(--text-secondary); margin-bottom: 28px; }

/* ============ 代码查看 ============ */
.code-view-section h2 { font-size: 1.2rem; margin-bottom: 18px; }
.code-toolbar { display: flex; gap: 12px; margin-bottom: 18px; }
.code-box {
    background: var(--console-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    overflow-x: auto;
    box-shadow: var(--shadow);
}
.code-box pre {
    font-family: Consolas, Monaco, "Courier New", monospace;
    font-size: 0.85rem;
    color: #b8bdd8;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.6;
}

/* ============ 页脚 ============ */
.footer {
    text-align: center;
    padding: 26px 20px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    background: rgba(15, 16, 35, 0.7);
    backdrop-filter: blur(8px);
}

/* ============ 响应式 ============ */
@media (max-width: 600px) {
    .nav-container { flex-direction: column; height: auto; padding: 14px 20px; gap: 12px; }
    .nav-menu { gap: 6px; flex-wrap: wrap; justify-content: center; }
    .hero h1 { font-size: 1.8rem; }
    .hero { padding: 50px 16px 36px; }
    .upload-form { flex-direction: column; align-items: stretch; }
    .file-table { font-size: 0.85rem; }
    .file-table th, .file-table td { padding: 10px 12px; }
    .container { padding: 28px 16px; }
}
