/**
 * ================================================================
 * PC端基础样式 - 全局重置 + PC端专属组件
 * 
 * 作用域条件：通过 PHP $isMobile 条件仅在 PC 端加载
 * 设计语言：小清新 + 玻璃拟态 + 时光感氛围
 * 
 * ⚠️ 重要约束：
 * - 本文件仅通过 PHP isset($isMobile) && !$isMobile 在 PC 端加载
 * - 严禁包含 @media (max-width: xxx) 移动端查询
 * - 严禁使用 d-block d-md-none / d-none d-md-block
 * - 零 !important（除非绝对必要）
 * ================================================================
 */

/* ================================================================
 * 全局基础重置（从原 global.css 迁移，仅 PC 端生效）
 * ================================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    caret-color: var(--color-primary);
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-body);
    font-weight: var(--font-weight-body);
    line-height: var(--line-height-body);
    color: var(--color-text-secondary);
    background-color: var(--color-bg-body);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 背景增强：噪点纹理 + 信封水印 */
body {
    background-color: var(--color-bg-body);
}

body::before {
    content: '✉';
    position: fixed;
    font-size: 200px;
    opacity: 0.03;
    top: -60px;
    right: -40px;
    transform: rotate(20deg);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '✉';
    position: fixed;
    font-size: 120px;
    opacity: 0.025;
    bottom: 40px;
    left: -30px;
    transform: rotate(-15deg);
    pointer-events: none;
    z-index: 0;
}

/* 通用卡片样式 */
.card-ui {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--color-text-primary);
    line-height: 1.4;
}
h1 {
    font-family: var(--font-family-display);
    font-size: var(--font-size-h1);
    font-weight: var(--font-weight-h1);
    line-height: var(--line-height-h1);
}
h2 {
    font-family: var(--font-family-display);
    font-size: var(--font-size-h2);
    font-weight: var(--font-weight-h2);
    line-height: var(--line-height-h2);
}
h3 {
    font-family: var(--font-family-display);
    font-size: var(--font-size-h3);
    font-weight: var(--font-weight-h3);
    line-height: var(--line-height-h3);
}
h4 {
    font-family: var(--font-family-display);
    font-size: var(--font-size-h4);
    font-weight: var(--font-weight-h4);
    line-height: var(--line-height-h4);
}

small, .text-muted {
    font-size: var(--font-size-body-small);
    color: var(--color-text-muted);
}

/* Body 字体变体 */
.body-large {
    font-size: var(--font-size-body-large);
    line-height: var(--line-height-body-large);
}

.caption {
    font-size: var(--font-size-caption);
    line-height: var(--line-height-caption);
    color: var(--color-text-muted);
}

/* 数字字体 - 等宽数字整齐美观 */
.font-numeric {
    font-family: var(--font-family-numeric);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s;
}
a:hover {
    color: var(--color-primary-dark);
}

/* 统一输入框样式 */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
textarea,
select {
    background: var(--color-input-bg);
    border: 1px solid var(--color-input-border);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    font-size: var(--font-size-body);
    color: var(--color-text-primary);
    transition: all 0.25s ease;
    outline: none;
    box-sizing: border-box;
    font-family: var(--font-family);
}
input:focus,
textarea:focus,
select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(44, 62, 80, 0.10);
}
::placeholder {
    color: var(--color-text-placeholder);
    opacity: 1;
}

/* 自动填充修复 - 去除浏览器默认黄/蓝底 */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px var(--color-input-bg) inset !important;
    box-shadow: 0 0 0 1000px var(--color-input-bg) inset !important;
    -webkit-text-fill-color: var(--color-text-primary) !important;
    caret-color: var(--color-text-primary);
    background-color: var(--color-input-bg) !important;
    background-clip: content-box !important;
}

/* 聚焦呼吸灯效果 - PC端增强版 */
.input-breath-wrap {
    position: relative;
}
.input-breath-wrap::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), left 0.5s ease;
    pointer-events: none;
}
.input-breath-wrap:focus-within::after {
    width: 100%;
    left: 0;
}

/* 柔和错误提示 */
.input-error {
    border-color: rgba(232, 160, 160, 0.7) !important;
}
.input-error:focus {
    border-color: var(--color-danger) !important;
    box-shadow: 0 0 0 3px rgba(232, 160, 160, 0.15) !important;
}
.error-hint {
    font-size: var(--font-size-caption);
    color: #c0392b;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    animation: hintIn 0.25s ease-out;
}
@keyframes hintIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 背景层级 class：页面按需引入 */
.bg-tier-efficiency { background-color: var(--color-bg-body); }
.bg-tier-immersive  { background-color: var(--color-bg-paper); }

/* ================================================================
 * 一、头部导航栏（PC端完整布局）
 * ================================================================ */

.header-wrapper {
    width: 100%;
    background: transparent;
    border-bottom: none;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 14px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.site-title-container {
    text-align: center;
    padding: 0 0 10px 0;
}

.navbar-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

.navbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    position: relative;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: none;
    box-shadow: none;
}

/* ================================================================
 * 二、容器与布局（PC端宽屏优化）
 * ================================================================ */

.page-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

.content {
    flex: 1;
    padding: 30px 0;
    padding-bottom: 30px;
}

/* ================================================================
 * 三、表单控件（PC端增强交互）
 * ================================================================ */

.form-group {
    margin-bottom: 22px;
}

.form-control {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e0e0e0;
    background-color: #fff;
    font-size: 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    color: #333;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}

.form-control::placeholder {
    color: #bbb;
}

/* ================================================================
 * 四、按钮体系（PC端悬停动效）
 * ================================================================ */

.btn-container {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin: 1.5rem 0;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    text-decoration: none;
    font-size: var(--font-size-body-small);
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    box-shadow: 0 4px 16px rgba(0, 102, 204, 0.25);
}

.btn:hover {
    background: var(--color-primary-light);
    box-shadow: 0 4px 20px rgba(0, 102, 204, 0.35);
    color: #fff;
}

.btn:active {
    transform: scale(0.97);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--color-primary);
    color: var(--color-primary);
    box-shadow: none;
    border-radius: var(--radius-pill);
}

.btn-outline:hover {
    background: var(--color-primary-soft);
    border-color: var(--color-primary-light);
    color: var(--color-primary-light);
}

/* ================================================================
 * 五、卡片组件（PC端浮起效果增强）
 * ================================================================ */

.card-ui {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.35s ease, transform 0.35s ease;
}

.card-ui:hover {
    box-shadow: var(--shadow-hover);
}

.card {
    border: none;
    padding: 28px;
    margin-bottom: 24px;
    background-color: var(--color-bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.4s ease;
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.card-title {
    font-size: var(--font-size-h4);
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 18px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 14px;
}

/* ================================================================
 * 六、提示消息（PC端柔和配色）
 * ================================================================ */

.alert {
    padding: 18px 24px;
    margin-bottom: 24px;
    border: none;
    border-radius: 10px;
    font-size: var(--font-size-body-small);
}

.alert-success {
    color: #2d7a4f;
    background-color: #eaf7ef;
    border-left: 4px solid #a8e6cf;
}

.alert-danger {
    color: #c0392b;
    background-color: #fdf0ef;
    border-left: 4px solid #ffb142;
}

.alert-info {
    color: #3a7bd5;
    background-color: #eef5fc;
    border-left: 4px solid var(--color-primary);
}

/* ================================================================
 * 七、徽章/标签（PC端精致设计）
 * ================================================================ */

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 14px;
    font-size: var(--font-size-caption);
    line-height: var(--line-height-caption);
    font-weight: 500;
}

.badge-success {
    background: #eaf7ef;
    color: #2d7a4f;
}

.badge-warning {
    background: #fff7e6;
    color: #c67c00;
}

.badge-public {
    background: #eaf7ef;
    color: #52c8b4;
}

.badge-private {
    background: #f5f5f7;
    color: #999;
}

/* ================================================================
 * 八、页脚（PC端居中布局）
 * ================================================================ */

.site-footer {
    text-align: center;
    padding: 28px 0 20px;
    margin-top: auto;
    background: transparent;
}
.footer-inner {
    max-width: 400px;
    margin: 0 auto;
}
.footer-quote {
    font-size: var(--font-size-body-small);
    color: #bbb;
    margin-bottom: 16px;
    letter-spacing: 1px;
    line-height: 1.6;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.footer-copyright {
    font-size: var(--font-size-caption);
    color: #999;
    margin-bottom: 6px;
}
.footer-brand {
    font-size: var(--font-size-h4);
    color: #bbb;
    margin-bottom: 8px;
    letter-spacing: 2px;
}
.footer-powered {
    font-size: var(--font-size-caption);
    color: #999;
}
.footer-powered a {
    color: var(--color-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--color-primary);
    padding-bottom: 1px;
    transition: color 0.2s;
}
.footer-powered a:hover {
    color: var(--color-primary-light);
    border-bottom-color: var(--color-primary-light);
}
/* 兼容旧 .footer 类 */
.footer {
    text-align: center;
    padding: 28px 0;
    margin-top: auto;
    background: transparent;
    position: relative;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.footer p {
    font-family: 'ZCOOL XiaoWei', sans-serif;
    margin: 0;
}

/* ================================================================
 * 九、空状态组件（PC端大图标）
 * ================================================================ */

.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: #999;
}

.empty-state-icon {
    font-size: 56px;
    margin-bottom: 18px;
    color: #ccc;
}

.empty-state-text {
    font-size: var(--font-size-body);
    margin-bottom: 24px;
    color: #999;
}

.empty-state-action {
    display: inline-block;
    padding: 12px 28px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-pill);
    font-size: var(--font-size-body-small);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,102,204,0.2);
}

.empty-state-action:hover {
    box-shadow: 0 4px 20px rgba(0,102,204,0.3);
    color: #fff;
}

/* ================================================================
 * 十、加载状态（PC端精致动画）
 * ================================================================ */

.loading-spinner {
    display: inline-block;
    width: 28px;
    height: 28px;
    border: 3px solid rgba(44, 62, 80, 0.15);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: pc-spin 0.9s linear infinite;
}

.loading-spinner-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

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

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 14px;
}

/* ================================================================
 * 十一、滚动条美化（PC端宽滚动条）
 * ================================================================ */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f5f5f7;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}

/* ================================================================
 * 十二、选中文字颜色（统一品牌色）
 * ================================================================ */

::selection {
    background: rgba(0, 102, 204, 0.15);
    color: var(--color-text-primary);
}

/* ================================================================
 * 十三、Header 毛玻璃效果
 * ================================================================ */

/* 导航栏毛玻璃效果 */
.site-header {
    position: sticky;
    top: 0;
    z-index: 9995;
    transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

/* PC端头部 */
.site-header-pc {
    background: rgba(248, 247, 244, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.site-header.glass {
    background: rgba(248, 247, 244, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.header-wrapper {
    transition: padding 0.3s ease;
}

.site-header.glass .header-wrapper {
    padding-top: 4px;
    padding-bottom: 4px;
}

/* ================================================================
 * 十四、PC端极简导航栏
 * ================================================================ */

.navbar-pc {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 60px;
}

.navbar-pc-left {
    flex-shrink: 0;
}

.navbar-logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-logo-text {
    font-family: "PingFang SC", "Noto Serif SC", serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--color-primary);
    letter-spacing: 2px;
}

.navbar-pc-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-pc-right a {
    position: relative;
    color: var(--color-text-muted);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.25s ease;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.navbar-pc-right a:hover {
    color: var(--color-primary);
    background: var(--color-primary-hover-bg);
}

.navbar-pc-right a.active {
    color: var(--color-primary);
    font-weight: 600;
}

.navbar-pc-right a.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--color-primary);
}

.navbar-logout {
    opacity: 0.7;
}

.navbar-logout:hover {
    opacity: 1;
}

/* 维护滚动横幅动画 */
@keyframes maintScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-33.33%); }
}

/* 维护横幅样式 */
.maint-banner {
    background: linear-gradient(90deg, #ff9800, #f57c00);
    color: #fff;
    padding: 8px 0;
    overflow: hidden;
    position: relative;
    z-index: 9999;
}

.maint-banner-inner {
    display: flex;
    white-space: nowrap;
    animation: maintScroll 20s linear infinite;
}

.maint-banner-inner span {
    padding: 0 50px;
    font-size: 14px;
    font-weight: 500;
}

.maint-banner-inner i {
    margin-right: 6px;
}

/* ================================================================
 * 十五、页面过渡动效
 * ================================================================ */
.page-fade-in {
    animation: pageFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 卡片入场序列动画 */
.card-enter {
    opacity: 0;
    transform: translateY(10px);
    animation: cardEnter 0.4s ease forwards;
}
@keyframes cardEnter {
    to { opacity: 1; transform: translateY(0); }
}
.card-enter:nth-child(1) { animation-delay: 0.05s; }
.card-enter:nth-child(2) { animation-delay: 0.1s; }
.card-enter:nth-child(3) { animation-delay: 0.15s; }
.card-enter:nth-child(4) { animation-delay: 0.2s; }

/* ================================================================
 * 十六、打字机光标效果
 * ================================================================ */
.typewriter-cursor::after {
    content: '|';
    display: inline;
    animation: cursorBlink 1s step-end infinite;
    color: var(--color-primary);
    font-weight: 300;
    margin-left: 2px;
}
@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* 信件沉浸阅读 */
.letter-immersive {
    position: relative;
    padding: 40px 48px;
    background: #faf6ef;
    border-radius: 4px;
    box-shadow:
        inset 0 2px 8px rgba(0,0,0,0.03),
        0 2px 8px rgba(0,0,0,0.05),
        0 8px 32px rgba(139,107,74,0.08);
    border: 1px solid rgba(200, 190, 170, 0.3);
    border-left: 3px solid #c9a96e;
}
.letter-immersive::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    pointer-events: none;
    z-index: 0;
}
.letter-immersive > * {
    position: relative;
    z-index: 1;
}

/* ================================================================
 * 通用内联SVG图标（替代fa-regular webfont）
 * ================================================================ */
.svg-inline-icon {
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    fill: currentColor;
    display: inline-block;
}
