/* 全局样式和通用组件 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #745bde;
    /* 优雅紫 */
    --primary-light: #9485ed;
    --primary-hover: #5d46c4;
    --secondary-color: #a78bfa;
    /* 淡紫色点缀 */
    --accent-color: #818cf8;
    /* 靛蓝色点缀 */
    --success-color: #54c982;
    /* 清新绿点缀 */
    --warning-color: #fbbf24;
    --danger-color: #ff5252;
    --bg-color: #f8f9ff;
    /* 极简淡紫底 */
    --card-bg: #ffffff;
    --text-primary: #2d3436;
    /* 现代深灰文字 */
    --text-secondary: #636e72;
    --border-color: #e2e8f0;
    --shadow-sm: 0 4px 6px -1px rgba(116, 91, 222, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(116, 91, 222, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(116, 91, 222, 0.15);
    --radius: 16px;
    /* 现代化圆角 */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-color);
    background-image:
        radial-gradient(at 0% 0%, rgba(116, 91, 222, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(167, 139, 250, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(84, 201, 130, 0.1) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(129, 140, 248, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
    /* 流体渐变艺术背景 */
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-10px) rotate(2deg);
    }
}

.container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* 按钮样式 */
.btn-primary {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    border: none;
    border-radius: var(--radius);
    /* 扁平化高级感 */
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    position: relative;
}

.btn-primary:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-bottom-width: 6px;
}

.btn-primary:active {
    transform: translateY(2px);
    border-bottom-width: 2px;
}

.btn-secondary {
    padding: 10px 20px;
    background: var(--card-bg);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    min-width: fit-content;
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    /* 细边框，简约风 */
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 400;
    transition: var(--transition);
    background: var(--card-bg);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(116, 91, 222, 0.15);
    background: #f5f3ff;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.code-input-group {
    display: flex;
    gap: 10px;
}

.code-input-group input {
    flex: 1;
}

.btn-code {
    padding: 12px 20px;
    background: var(--card-bg);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.btn-code:hover {
    background: var(--primary-color);
    color: white;
}

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

/* 卡片样式 */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 3px solid var(--border-color);
    box-shadow: var(--shadow-md);
    padding: 24px;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
    border-color: var(--primary-light);
}

/* 标签样式 */
.tag {
    display: inline-block;
    padding: 6px 14px;
    background: #f5f3ff;
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
    min-width: 50px;
    text-align: center;
    line-height: 1.4;
}

.tag-success {
    padding: 4px 12px;
    border-radius: 60px;
    background: #E8F5E9;
    color: var(--success-color);
    
}

.tag-warning {
    padding: 4px 12px;
    border-radius: 60px;
    background: #fef3c7;
    color: var(--warning-color);
    
}

.tag-danger {
    background: #FFEBEE;
    color: var(--danger-color);
    border: 1px solid rgba(255, 82, 82, 0.3);
}

/* 链接样式 */
.link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

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

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 消息提示 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 14px 20px;
    background: var(--card-bg);
    color: var(--text-primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 10000;
    animation: slideIn 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.success {
    background: var(--success-color);
    color: white;
}

.toast.error {
    background: var(--danger-color);
    color: white;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 导航栏样式（用户端） */
.navbar {
    background: var(--card-bg);
    box-shadow: var(--shadow-sm);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h2 {
    font-size: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    padding: 8px 0;
    position: relative;
}

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

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 24px;
    border-left: 1px solid var(--border-color);
}

.user-info span {
    color: var(--text-primary);
    font-size: 14px;
}

.btn-logout {
    padding: 6px 12px;
    background: var(--bg-color);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-logout:hover {
    background: var(--danger-color);
    color: white;
    border-color: var(--danger-color);
}

/* 响应式 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .code-input-group {
        flex-direction: column;
    }

    .btn-code {
        width: 100%;
    }

    .nav-container {
        flex-wrap: wrap;
        gap: 12px;
    }

    .nav-menu {
        flex-wrap: wrap;
        gap: 12px;
    }

    .user-info {
        padding-left: 0;
        border-left: none;
        border-top: 1px solid var(--border-color);
        padding-top: 12px;
        width: 100%;
        justify-content: space-between;
    }
}

/* 模态框通用样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-out;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 28px;
    font-weight: 300;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-color);
    color: var(--text-primary);
}

/* 图标通用样式 */
.icon {
    width: 1em;
    height: 1em;
    vertical-align: -0.15em;
    fill: none;
    stroke: currentColor;
    overflow: visible;
    display: inline-block;
}

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon .icon {
    width: 32px;
    height: 32px;
    color: var(--primary-color);
}

.nav-icon {
    display: flex;
    align-items: center;
}

.nav-icon .icon {
    width: 18px;
    height: 18px;
    margin-right: 8px;
}

.upload-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.upload-icon .icon {
    width: 64px;
    height: 64px;
    color: var(--primary-color);
    opacity: 0.6;
}

/* 居中（水平居中）+ 字号16px 基础样式 */
.align-center-16px {
  font-size: 14px; /* 字号16px */
  text-align: center; /* 文本水平居中（适用于行内/行内块/文本内容） */
  margin: 0 auto; /* 块级元素自身水平居中（需配合设置宽度，否则宽度100%无法体现居中效果） */
  width: fit-content; /* 可选：让块级元素宽度自适应内容，避免默认100%宽度 */
}