/* Google Fonts loaded asynchronously via JS - do NOT use @import */

/**
 * ZAUN Website Shared Styles v1.0.0
 * Pixel Art / Retro Theme - 与 zaun-auth.css 和 zaun-chat.css 统一设计语言
 */

/* ==================== 重置 & 全局 ==================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 像素色板 */
    --zs-primary: #33ffcc;
    --zs-primary-dark: #009977;
    --zs-accent: #ffcc00;
    --zs-danger: #ff0044;
    --zs-success: #00ff88;

    --zs-bg-body: #060610;
    --zs-bg-panel: #0a0a1a;
    --zs-bg-input: #000000;
    --zs-bg-card: #0d0d20;

    --zs-border: #33ffcc;
    --zs-border-dim: #1a4a40;
    --zs-shadow: #000000;

    --zs-text: #ffffff;
    --zs-text-muted: #7aa8c0;
    --zs-text-dim: #445566;

    --zs-font-title: 'Press Start 2P', cursive;
    --zs-font-body: 'DotGothic16', 'Courier New', monospace;
    --zs-mobile-safe-gap: clamp(8px, 2vw, 16px);
    --zs-mobile-panel-max: min(100vw - (var(--zs-mobile-safe-gap) * 2), 1100px);
}

/* ==================== 全局自定义滚动条 ==================== */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--zs-primary) transparent;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--zs-bg-body);
}

::-webkit-scrollbar-thumb {
    background: var(--zs-primary);
    border: none;
}

::-webkit-scrollbar-thumb:hover {
    background: #fff;
}

body {
    font-family: var(--zs-font-body);
    background: var(--zs-bg-body);
    color: var(--zs-text);
    min-height: 100vh;
    image-rendering: pixelated;
    overflow-x: hidden;
}

/* 像素网格背景（全局） */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(51, 255, 204, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(51, 255, 204, 0.02) 1px, transparent 1px);
    background-size: 24px 24px;
    pointer-events: none;
    z-index: 0;
}

a {
    color: var(--zs-accent);
    text-decoration: none;
    font-weight: bold;
}

a:hover {
    text-decoration: underline;
}

/* ==================== 导航栏 ==================== */
.zs-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--zs-bg-panel);
    border-bottom: 2px solid var(--zs-border-dim);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
}

/* 顶部青色装饰条 */
.zs-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--zs-primary);
}

.zs-nav-logo {
    font-family: var(--zs-font-title);
    font-size: 14px;
    color: var(--zs-primary);
    letter-spacing: 1px;
}

.zs-nav-links {
    display: flex;
    gap: 12px;
}

.zs-nav-btn {
    font-family: var(--zs-font-body);
    font-size: 14px;
    padding: 8px 16px;
    border: 2px solid var(--zs-border-dim);
    background: transparent;
    color: var(--zs-text-muted);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.1s steps(2);
}

.zs-nav-btn:hover {
    border-color: var(--zs-primary);
    color: var(--zs-primary);
    text-decoration: none;
}

.zs-nav-btn-primary {
    background: var(--zs-primary);
    border-color: var(--zs-primary);
    color: #000;
    font-weight: bold;
    box-shadow: 2px 2px 0px var(--zs-shadow);
}

.zs-nav-btn-primary:hover {
    background: #fff;
    color: #000;
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0px var(--zs-shadow);
}

.zs-nav-user {
    display: none;
    align-items: center;
    gap: 12px;
}

.zs-nav-user.show {
    display: flex;
}

.zs-nav-links.hide {
    display: none;
}

.zs-nav-username {
    color: var(--zs-primary);
    font-size: 14px;
}

/* ==================== 卡片 / 面板 ==================== */
.zs-card {
    background: var(--zs-bg-panel);
    border: 2px solid var(--zs-border-dim);
    padding: 32px;
    box-shadow: 6px 6px 0px var(--zs-shadow);
    position: relative;
}

/* 卡片顶部装饰条 */
.zs-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    height: 4px;
    background: var(--zs-primary);
}

.zs-card-hover {
    transition: transform 0.1s steps(2), border-color 0.1s steps(2);
    cursor: pointer;
}

.zs-card-hover:hover {
    border-color: var(--zs-primary);
    transform: translate(-2px, -2px);
    box-shadow: 8px 8px 0px var(--zs-shadow);
}

.zs-card-hover:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

/* ==================== 表单元素 ==================== */
.zs-form-group {
    margin-bottom: 18px;
}

.zs-label {
    display: block;
    font-size: 14px;
    margin-bottom: 6px;
    color: var(--zs-primary);
    text-transform: uppercase;
}

.zs-input {
    width: 100%;
    padding: 12px;
    background: var(--zs-bg-input);
    border: 2px solid #333;
    color: var(--zs-primary);
    font-family: var(--zs-font-body);
    font-size: 15px;
    outline: none;
}

.zs-input:focus {
    border-color: var(--zs-primary);
    background: #050505;
}

.zs-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.zs-input::placeholder {
    color: var(--zs-text-dim);
}

/* ==================== 按钮 ==================== */
.zs-btn {
    display: inline-block;
    padding: 14px 24px;
    background: var(--zs-primary);
    border: 2px solid #000;
    color: #000;
    font-family: var(--zs-font-title);
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 4px 4px 0px var(--zs-shadow);
    transition: transform 0.1s steps(2);
    text-align: center;
    text-decoration: none;
}

.zs-btn:hover:not(:disabled) {
    background: #fff;
    transform: translate(-1px, -1px);
    box-shadow: 5px 5px 0px var(--zs-shadow);
    text-decoration: none;
}

.zs-btn:active:not(:disabled) {
    transform: translate(2px, 2px);
    box-shadow: none;
}

.zs-btn:disabled {
    background: #333;
    color: #666;
    border-color: #000;
    cursor: not-allowed;
    box-shadow: none;
}

.zs-btn-full {
    width: 100%;
}

.zs-btn-secondary {
    background: transparent;
    border-color: var(--zs-primary);
    color: var(--zs-primary);
    box-shadow: none;
    font-family: var(--zs-font-body);
    font-size: 14px;
}

.zs-btn-secondary:hover:not(:disabled) {
    background: var(--zs-primary);
    color: #000;
}

.zs-btn-danger {
    background: transparent;
    border-color: var(--zs-danger);
    color: var(--zs-danger);
    box-shadow: none;
    font-family: var(--zs-font-body);
    font-size: 14px;
}

.zs-btn-danger:hover:not(:disabled) {
    background: var(--zs-danger);
    color: #fff;
}

/* ==================== 消息提示 ==================== */
.zs-msg {
    padding: 10px;
    border: 2px solid transparent;
    font-size: 14px;
    text-align: center;
    margin-bottom: 16px;
}

.zs-msg.error {
    background: #1a0000;
    border-color: var(--zs-danger);
    color: #ff3366;
}

.zs-msg.success {
    background: #001a0a;
    border-color: var(--zs-success);
    color: var(--zs-success);
}

.zs-msg.hidden {
    display: none;
}

/* ==================== 验证码行 ==================== */
.zs-code-row {
    display: flex;
    gap: 8px;
}

.zs-code-row .zs-input {
    flex: 1;
}

.zs-code-btn {
    padding: 0 14px;
    background: #1a1a2e;
    border: 2px solid var(--zs-primary);
    color: var(--zs-primary);
    cursor: pointer;
    font-family: var(--zs-font-body);
    font-size: 13px;
    white-space: nowrap;
}

.zs-code-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #444;
    color: #666;
}

/* ==================== 复选框 ==================== */
.zs-checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--zs-text-muted);
    margin: 8px 0;
    cursor: pointer;
}

.zs-checkbox-row input[type="checkbox"] {
    appearance: none;
    width: 14px;
    height: 14px;
    border: 2px solid var(--zs-primary);
    background: #000;
    cursor: pointer;
    position: relative;
}

.zs-checkbox-row input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: var(--zs-primary);
}

/* ==================== 选项行（记住密码 + 显示密码） ==================== */
.zs-options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0 16px;
}

/* ==================== 页脚 ==================== */
.zs-footer {
    text-align: center;
    padding: 24px;
    color: var(--zs-text-dim);
    font-size: 13px;
    border-top: 2px solid var(--zs-border-dim);
    margin-top: auto;
}

/* ==================== 链接区 ==================== */
.zs-link-area {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--zs-text-muted);
}

/* ==================== 标题 ==================== */
.zs-title {
    font-family: var(--zs-font-title);
    font-size: 20px;
    text-align: center;
    margin-bottom: 8px;
    color: var(--zs-primary);
}

.zs-subtitle {
    font-size: 15px;
    color: var(--zs-text-muted);
    text-align: center;
    margin-bottom: 24px;
}

/* ==================== Hero Section ==================== */
.zs-hero {
    text-align: center;
    padding: 120px 24px 48px;
    position: relative;
    z-index: 1;
}

.zs-hero-title {
    font-family: var(--zs-font-title);
    font-size: 28px;
    color: var(--zs-primary);
    margin-bottom: 16px;
    line-height: 1.6;
    letter-spacing: 2px;
}

.zs-hero-sub {
    font-size: 16px;
    color: var(--zs-text-muted);
    margin-bottom: 32px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ==================== 功能网格 ==================== */
.zs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

.zs-grid-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.zs-grid-title {
    font-family: var(--zs-font-title);
    font-size: 11px;
    margin-bottom: 8px;
    color: var(--zs-primary);
}

.zs-grid-desc {
    color: var(--zs-text-muted);
    font-size: 14px;
}

.zs-tag {
    display: inline-block;
    padding: 4px 8px;
    border: 1px solid var(--zs-primary);
    font-size: 11px;
    color: var(--zs-primary);
    margin-top: 8px;
}

/* ==================== 布局 ==================== */
.zs-center-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    z-index: 1;
}

.zs-auth-container {
    width: 100%;
    max-width: 420px;
}

/* ==================== 页面顶栏（非 fixed） ==================== */
.zs-header {
    background: var(--zs-bg-panel);
    border-bottom: 2px solid var(--zs-border-dim);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.zs-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--zs-primary);
}

.zs-header-logo {
    font-family: var(--zs-font-title);
    font-size: 14px;
    color: var(--zs-primary);
}

.zs-header-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.zs-header-username {
    color: var(--zs-text-muted);
    font-size: 14px;
}

/* ==================== 容器 ==================== */
.zs-container {
    max-width: var(--zs-mobile-panel-max);
    margin: 24px auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* ==================== 欢迎面板 ==================== */
.zs-welcome {
    text-align: center;
    padding: 28px;
    margin-bottom: 24px;
}

.zs-welcome h1 {
    font-family: var(--zs-font-title);
    font-size: 16px;
    color: var(--zs-primary);
    margin-bottom: 10px;
}

.zs-welcome p {
    color: var(--zs-text-muted);
    font-size: 15px;
}

/* ==================== 工具 ==================== */
.hidden {
    display: none;
}

/* ==================== 响应式 ==================== */
@media (max-width: 640px) {
    body {
        min-width: 320px;
    }

    .zs-hero-title {
        font-size: 18px;
    }

    .zs-nav {
        padding: 0 12px;
    }

    .zs-grid {
        grid-template-columns: 1fr;
        padding: 0 12px;
    }

    .zs-container,
    .zs-center-page {
        padding-left: var(--zs-mobile-safe-gap);
        padding-right: var(--zs-mobile-safe-gap);
    }
}