/* app/static/css/style.css */
:root {
    --primary-orange: #ff5e00;
    --light-orange: #fff0e6;
    --cyber-black: #1a1a1a;
    --cyber-gray: #e5e7eb;
    --text-main: #2d3436;
    --text-light: #636e72;
    --bg-color: #f4f6f8;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --border-color: #d1d5db;
    --tech-font: 'JetBrains Mono', monospace;
    --body-font: 'Inter', sans-serif;
}

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

body {
    font-family: var(--body-font);
    background-color: var(--bg-color);
    /* 赛博风格网格背景 */
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ================= 导航栏 ================= */
.navbar {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    height: 70px;
}

.nav-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0 3rem;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo */
.nav-logo {
    display: flex;
    align-items: center;
    /* 消除 flex gap，改用图片的 margin 来精确控制距离 */
    gap: 0;
    text-decoration: none;
    color: var(--cyber-black);
    height: 100%;
    /* 增加一点左侧负边距，让大图标不至于显得离左边太远 */
    margin-left: -10px;
}

/* Logo 图片 */
.logo-img {
    /* 1. 物理尺寸加大 */
    width: 64px;
    height: 64px;

    /* 2. 保持清晰度，不做缩放变形 */
    object-fit: contain;

    /* 3. 关键：使用负边距抵消图片自带的留白 */
    /* 因为图片里的橙子只有中间一点点，我们需要把图片"拉"近文字 */
    margin-right: -8px;

    /* 4. 去除之前的 drop-shadow，因为它会暴露图片的方形边界 */
    filter: none;

    /* 5. 如果你想让它有点科技感，可以加一点透明度变化而不是阴影 */
    opacity: 0.95;
    transition: opacity 0.3s;
}

.nav-logo:hover .logo-img {
    opacity: 1;
}

/* 文字部分微调 */
.brand-text {
    font-family: var(--tech-font);
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: -0.5px;
    position: relative;
    top: 1px;
    left: 5px;
}

.brand-dot {
    color: var(--primary-orange);
}

/* 右侧组：菜单 + 用户 */
.nav-right-group {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    font-family: var(--tech-font);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-light);
    text-decoration: none;
    position: relative;
    padding: 5px 0;
    transition: color 0.3s;
}

.link-icon {
    color: var(--primary-orange);
    margin-right: 2px;
}

.nav-link:hover {
    color: var(--primary-orange);
}

/* 简单的下划线动画 */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-orange);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.nav-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    transform: skewX(-15deg);
}

/* ================= 按钮与用户状态 ================= */
.nav-user-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-badge {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.1;
}

.user-role {
    font-size: 0.6rem;
    font-family: var(--tech-font);
    color: var(--primary-orange);
    text-transform: uppercase;
}

.user-name {
    font-weight: 700;
    font-size: 0.9rem;
}

/* 赛博按钮通用样式 */
.btn-cyber {
    position: relative;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    text-decoration: none;
    outline: none;
}

.btn-cyber .btn-content {
    display: block;
    padding: 8px 20px;
    font-family: var(--tech-font);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    /* 切角效果 */
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    transition: all 0.2s ease;
}

/* 登录按钮风格 (实心橙色) */
.btn-login .btn-content {
    background: var(--primary-orange);
    color: white;
}

.btn-login:hover .btn-content {
    background: #e65100;
    transform: translate(-1px, -1px);
    box-shadow: 2px 2px 0px var(--cyber-black);
}

/* 退出按钮风格 (边框风格) */
.btn-logout .btn-content {
    background: transparent;
    color: var(--text-light);
    border: 1px solid var(--border-color);
    /* 模拟边框的clip-path比较复杂，这里用背景色模拟 */
    background: white;
    border: 1px solid #ccc;
    /* Fallback */
}

.btn-logout:hover .btn-content {
    color: #ef4444;
    border-color: #ef4444;
    background: #fff5f5;
}

/* ================= 页脚 ================= */
.footer {
    padding: 20px 0;
    text-align: center;
    /* 如果需要背景色可以在这里加，比如 background: #000; */
}

.footer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px; /* 两行文字之间的间距 */
}

/* 版权文字样式 */
.footer-text {
    font-family: 'JetBrains Mono', monospace; /* 保持字体一致 */
    font-size: 12px;
    color: #666; /* 深灰色，不抢眼 */
    margin: 0;
}

/* 备案号样式 - 伪装成普通文字 */
.footer-beian {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: #666;          /* 和上面版权文字颜色一样 */
    text-decoration: none; /* 去掉下划线 */
    opacity: 0.8;
    transition: opacity 0.2s;
}

/* 只有鼠标放上去时才稍微变亮一点点，证明它是活的 */
.footer-beian:hover {
    opacity: 1;
    color: #888;
}

/* ================= 登录页专用样式 ================= */
/* 这些样式用于 login.html */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 140px);
    /* 减去导航和页脚 */
    padding: 20px;
}

.cyber-card {
    background: white;
    width: 100%;
    max-width: 400px;
    padding: 40px;
    position: relative;
    /* 科技感边框 */
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* 卡片装饰角标 */
.cyber-card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    width: 20px;
    height: 20px;
    border-top: 3px solid var(--primary-orange);
    border-left: 3px solid var(--primary-orange);
}

.cyber-card::after {
    content: '';
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 20px;
    height: 20px;
    border-bottom: 3px solid var(--primary-orange);
    border-right: 3px solid var(--primary-orange);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-title {
    font-family: var(--tech-font);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--cyber-black);
    margin-bottom: 5px;
}

.auth-subtitle {
    font-size: 0.9rem;
    color: var(--text-light);
}

.cyber-input-group {
    margin-bottom: 20px;
}

.cyber-label {
    display: block;
    font-family: var(--tech-font);
    font-size: 0.8rem;
    margin-bottom: 8px;
    color: var(--text-main);
}

.cyber-input {
    width: 100%;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    font-family: var(--tech-font);
    font-size: 0.95rem;
    color: var(--cyber-black);
    transition: all 0.3s;
    border-radius: 0;
    /* 直角 */
}

.cyber-input:focus {
    outline: none;
    border-color: var(--primary-orange);
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 94, 0, 0.1);
}

.btn-block {
    width: 100%;
}

.btn-block .btn-content {
    text-align: center;
    padding: 14px;
}

.auth-footer {
    margin-top: 20px;
    text-align: center;
    font-size: 0.9rem;
}

.auth-link {
    color: var(--primary-orange);
    text-decoration: none;
    font-weight: 600;
}

.auth-link:hover {
    text-decoration: underline;
}

.error-message {
    background: #fff5f5;
    color: #c0392b;
    padding: 10px;
    font-size: 0.85rem;
    border-left: 3px solid #c0392b;
    margin-bottom: 20px;
    display: none;
    /* 默认隐藏 */
}

/* 导航链接激活状态 */
.nav-link.active {
    color: #ff7e5f; /* 橙色高亮 */
    text-shadow: 0 0 8px rgba(255, 126, 95, 0.4);
}

.nav-link.active .link-icon {
    color: #ff7e5f;
    border-color: #ff7e5f;
}