/* 现代化统一导航样式 - 底部导航优先 */
:root {
    --primary-color: #07C160;
    --primary-dark: #05A050;
    --primary-light: #E6F7F0;
    --secondary-color: #576B95;
    --accent-color: #FF6B35;
    --text-primary: #1A1A1A;
    --text-secondary: #6B7280;
    --text-light: #9CA3AF;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F5F5F5;
    --bg-gray: #FAFAFA;
    --border-color: #E5E5E5;
    --border-light: #F0F0F0;
    --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-strong: 0 8px 24px rgba(0, 0, 0, 0.12);
    --radius-small: 8px;
    --radius-medium: 12px;
    --radius-large: 16px;

    /* 响应式断点 */
    --breakpoint-xs: 480px;
    --breakpoint-sm: 768px;
    --breakpoint-md: 1024px;
    --breakpoint-lg: 1200px;
    --breakpoint-xl: 1440px;

    /* 深色模式变量 */
    --dark-text-primary: #FFFFFF;
    --dark-text-secondary: #B3B3B3;
    --dark-text-light: #8A8A8A;
    --dark-bg-primary: #1A1A1A;
    --dark-bg-secondary: #2D2D2D;
    --dark-bg-gray: #121212;
    --dark-border-color: #404040;
    --dark-border-light: #2A2A2A;
}

/* 深色模式 */
[data-theme="dark"] {
    --text-primary: var(--dark-text-primary);
    --text-secondary: var(--dark-text-secondary);
    --text-light: var(--dark-text-light);
    --bg-primary: var(--dark-bg-primary);
    --bg-secondary: var(--dark-bg-secondary);
    --bg-gray: var(--dark-bg-gray);
    --border-color: var(--dark-border-color);
    --border-light: var(--dark-border-light);
    --shadow-light: 0 1px 3px rgba(255, 255, 255, 0.1);
    --shadow-medium: 0 4px 12px rgba(255, 255, 255, 0.08);
    --shadow-strong: 0 8px 24px rgba(255, 255, 255, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    /* 优化的中日文字体堆栈 */
    font-family:
        /* 系统字体优先 */
        -apple-system, BlinkMacSystemFont,
        /* 中文字体 */
        'PingFang SC', 'PingFang TC', 'Hiragino Sans GB', 'Source Han Sans SC', 'Noto Sans SC', 'Microsoft YaHei UI', 'Microsoft YaHei',
        /* 日文字体 */
        'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Source Han Sans JP', 'Noto Sans JP', 'Meiryo',
        /* 韩文字体 */
        'Source Han Sans KR', 'Noto Sans KR', 'Malgun Gothic',
        /* 西文字体后备 */
        'Segoe UI', Roboto, 'Helvetica Neue', Helvetica, Arial,
        sans-serif,
        /* 表情符号支持 */
        'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji';

    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-gray);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "kern" 1;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

/* 主布局 */
.layout {
    min-height: 100vh;
    padding-bottom: 80px; /* 为底部导航留出空间 */
    display: flex;
    flex-direction: column;
}

/* 品牌标识 - PC端顶部 */
.brand-header {
    display: none;
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    padding: 16px 24px;
    backdrop-filter: blur(10px);
}

@media (min-width: 769px) {
    .brand-header {
        display: none; /* 需求：PC端不显示品牌头部 */
    }
}

.brand-header .brand {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.brand-header .user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-header .theme-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-small);
    transition: background-color 0.3s ease;
}

.brand-header .theme-toggle:hover {
    background-color: var(--bg-secondary);
}

.brand-header .user-greeting {
    color: var(--text-secondary);
}

.brand-header .username {
    font-weight: 600;
    color: var(--text-primary);
}

/* 首页窄顶栏（作用域：仅首页） */
[data-page="home"] .home-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(90deg, rgba(7, 193, 96, 0.12), transparent 60%), var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 0; /* 顶部不圆角 */
    padding: 6px 12px;
    height: 44px;
    box-shadow: var(--shadow-light);
    margin: 0 0 8px; /* 顶部不留空 */
    padding-left: calc(12px + env(safe-area-inset-left, 0px));
    padding-right: calc(12px + env(safe-area-inset-right, 0px));
    position: sticky;
    top: 0;
    z-index: 120;
}
/* 让首页顶栏在居中内容容器中实现满屏效果 */
[data-page="home"] .home-topbar {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    max-width: 100vw;
}
[data-page="home"] .topbar-left { flex: 0 0 auto; }
[data-page="home"] .topbar-center { flex: 1 1 auto; text-align: center; min-width: 0; }
[data-page="home"] .topbar-right { flex: 0 0 42%; min-width: 160px; }

[data-page="home"] .home-title {
    display: inline-block;
    font-size: 18px;
    font-weight: 900;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 0.2px;
}
[data-page="home"] .home-title:hover { color: var(--primary-color); }

[data-page="home"] .home-tagline {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 窄屏也保留副标题，但适当压缩 ticker 宽度 */
@media (max-width: 480px) {
    [data-page="home"] .home-title { font-size: 16px; }
    [data-page="home"] .home-tagline { font-size: 11px; }
    [data-page="home"] .topbar-right { flex-basis: 50%; min-width: 120px; }
}

/* 滚动公告（Ticker） */
[data-page="home"] .ticker {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 28px;
}
[data-page="home"] .ticker-track {
    display: inline-flex;
    gap: 24px;
    white-space: nowrap;
    will-change: transform;
    animation: ticker-scroll 20s linear infinite;
}
[data-page="home"] .ticker-item { color: var(--text-secondary); font-size: 12px; }
[data-page="home"] .ticker:hover .ticker-track { animation-play-state: paused; }

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

/* 关于弹窗正文 */
.about-body {
    padding: 16px 20px 20px;
    color: var(--text-secondary);
}
.about-body p { margin: 0 0 10px; }

@media (min-width: 769px) {
    .home-header { padding: 24px 28px; }
    .home-title { font-size: 28px; }
}

/* 主要内容区域 */
.content {
    flex: 1;
    padding: 20px 16px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

@media (min-width: 769px) {
    .content {
        padding: 32px 24px;
    }
}

/* 统一底部导航栏 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-light);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-medium);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* 移除PC端居中盒式，保持全宽自适应 */

.bottom-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0;
    height: 70px;
}

@media (min-width: 769px) {
    .bottom-nav-items {
        padding: 12px 20px;
        height: 80px;
    }
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-light);
    transition: all 0.3s ease;
    padding: 8px 12px;
    border-radius: var(--radius-small);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    min-width: 60px;
}

@media (min-width: 769px) {
    .nav-item {
        padding: 12px 16px;
        min-width: 80px;
    }
}

.nav-item:hover, .nav-item.active {
    color: var(--primary-color);
    background-color: var(--primary-light);
}

[data-theme="dark"] .nav-item:hover,
[data-theme="dark"] .nav-item.active {
    background-color: rgba(7, 193, 96, 0.1);
}

.nav-item-icon {
    font-size: 22px;
    margin-bottom: 4px;
}

@media (min-width: 769px) {
    .nav-item-icon {
        font-size: 26px;
        margin-bottom: 6px;
    }
}

.nav-item-text {
    font-size: 12px;
    font-weight: 500;
}

@media (min-width: 769px) {
    .nav-item-text {
        font-size: 14px;
    }
}

/* 导航栏未读徽标 */
.nav-badge {
    position: absolute;
    top: 4px;
    right: 8px;
    background: #F44336;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* 弹出菜单样式 */
.popup-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.popup-menu.active {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background: var(--bg-primary);
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-strong);
    border: 1px solid var(--border-color);
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.popup-menu.active .popup-content {
    transform: scale(1) translateY(0);
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-light);
}

.popup-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

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

.popup-nav {
    padding: 0 16px 20px;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section:last-child {
    margin-bottom: 0;
}

.nav-section h4 {
    margin: 16px 8px 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-section a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-primary);
    border-radius: var(--radius-medium);
    transition: all 0.3s ease;
    margin-bottom: 4px;
}

.nav-section a:hover {
    background-color: var(--bg-secondary);
}

.nav-section a.active {
    background-color: var(--primary-light);
    color: var(--primary-color);
}

.nav-section a.disabled {
    opacity: 0.5;
    pointer-events: none;
}

[data-theme="dark"] .nav-section a.active {
    background-color: rgba(7, 193, 96, 0.1);
}

.nav-section a .icon {
    font-size: 20px;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

/* 菜单遮罩 */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1900;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-medium);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    line-height: 1.4;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

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

.btn-quiet {
    background: transparent;
    color: var(--text-secondary);
    padding: 8px 16px;
    font-size: 14px;
}

.btn-quiet:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* 已移除：旧首页功能卡片与徽章样式（未使用） */

/* 账户弹出菜单 - 概要 */
.account-summary {
    padding: 20px 20px;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(135deg, var(--primary-light), transparent 60%), var(--bg-primary);
}
.account-summary .summary-row {
    display: flex;
    align-items: center;
    gap: 14px;
}
.account-summary .avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.account-summary .avatar.large {
    width: 56px;
    height: 56px;
    font-size: 24px;
    font-weight: 700;
}
.account-summary .name {
    font-weight: 800;
    font-size: 18px;
}
.account-summary .meta {
    color: var(--text-secondary);
    font-size: 12px;
}

.account-summary .level-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--primary-light);
    color: var(--primary-dark);
    border: 1px solid var(--border-light);
    margin-right: 6px;
}

.account-summary .guest-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    margin-right: 6px;
}

.account-actions {
    display: flex;
    gap: 10px;
    padding: 8px 12px 4px;
    justify-content: center;
}

/* 刷新动画遮罩与加载指示器 */
.refresh-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.08);
    backdrop-filter: saturate(120%) blur(4px);
    -webkit-backdrop-filter: saturate(120%) blur(4px);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
}
.refresh-overlay.active { display: flex; }

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(0,0,0,0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* 表单容器与基础表单元素（用于登录/注册/资料页） */
.form-container {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-medium);
    box-shadow: var(--shadow-light);
    padding: 20px;
}

.form-container .form-group {
    margin-bottom: 16px;
}

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

.form-container input,
.form-container select,
.form-container textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-medium);
    font-size: 16px;
    transition: all 0.2s ease;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-container input:focus,
.form-container select:focus,
.form-container textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.1);
}

/* 卡片内表单元素（无需 form-container 包裹） */
.card-body input[type="text"],
.card-body input[type="password"],
.card-body input[type="number"],
.card-body input[type="email"],
.card-body select,
.card-body textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-medium);
    font-size: 15px;
    transition: all 0.2s ease;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.card-body input[type="text"]:focus,
.card-body input[type="password"]:focus,
.card-body input[type="number"]:focus,
.card-body input[type="email"]:focus,
.card-body select:focus,
.card-body textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.1);
}

.form-actions {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-container .helptext {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-light);
}

.form-container .error {
    margin-top: 6px;
    font-size: 12px;
    color: var(--accent-color);
}

/* 示例列表（广场/首页预览） */
.sample-feed {
    padding-left: 20px;
    color: var(--text-secondary);
}

/* 卡片样式 */
.card {
    background: var(--bg-primary);
    border-radius: var(--radius-medium);
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
    overflow: hidden;
    box-shadow: var(--shadow-light); /* 默认也有轻微阴影，提升卡片感 */
    margin: 12px 0; /* 与周围内容分隔 */
}

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

.card-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--border-light);
}

.card-body {
    padding: 20px 24px;
}

.card-footer {
    padding: 16px 24px 20px;
    background: var(--bg-gray);
    border-top: 1px solid var(--border-light);
}

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

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

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-medium);
    font-size: 16px;
    transition: all 0.3s ease;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

/* 消息样式 */
.messages {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.messages li {
    padding: 12px 16px;
    margin-bottom: 12px;
    border-radius: var(--radius-medium);
    background: var(--primary-light);
    color: var(--primary-dark);
    border-left: 4px solid var(--primary-color);
}

[data-theme="dark"] .messages li {
    background: rgba(7, 193, 96, 0.1);
    color: var(--primary-color);
}

/* 响应式优化 */
@media (max-width: 480px) {
    .content {
        padding: 16px 12px;
    }

    .nav-item {
        padding: 6px 8px;
        min-width: 50px;
    }

    .nav-item-icon {
        font-size: 20px;
    }

    .nav-item-text {
        font-size: 11px;
    }

    .popup-content {
        width: 95%;
        max-height: 85vh;
    }

    .popup-header {
        padding: 16px 20px 12px;
    }

    .popup-nav {
        padding: 0 12px 16px;
    }
}

@media (min-width: 1201px) {
    .content {
        padding: 40px 32px;
    }
}

/* 动画和过渡效果 */
.nav-item {
    position: relative;
    overflow: hidden;
}

.nav-item:active {
    transform: scale(0.95);
}

/* 主题切换动画 */
.theme-toggle.animating {
    transform: rotate(360deg);
}

/* 无障碍和用户体验优化 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .ticker-track { animation: none !important; }
}

/* 首页去掉主内容顶部内边距，使顶栏顶头显示 */
[data-page="home"] .content {
    padding-top: 0;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --border-light: #000000;
        --text-light: #000000;
    }

    [data-theme="dark"] {
        --border-color: #FFFFFF;
        --border-light: #FFFFFF;
        --text-light: #FFFFFF;
    }
}

/* 触摸设备优化 */
@media (pointer: coarse) {
    .nav-item {
        min-height: 44px;
        min-width: 44px;
    }

    .btn {
        min-height: 44px;
        padding: 12px 20px;
    }
}

/* 浮动导航球 */
.floating-nav-ball {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #0d47a1 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(7, 193, 96, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    user-select: none;
}

.floating-nav-ball:hover {
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 8px 32px rgba(7, 193, 96, 0.4);
}

.floating-nav-ball:active {
    transform: translateY(0) scale(1.05);
}

.nav-ball-icon {
    color: white;
    transition: transform 0.2s ease;
}

.floating-nav-ball:hover .nav-ball-icon {
    transform: rotate(90deg);
}

/* 浮动导航球响应式设计 */
@media (max-width: 768px) {
    .floating-nav-ball {
        width: 52px;
        height: 52px;
        bottom: 20px;
        left: 20px;
    }

    .nav-ball-icon svg {
        width: 20px;
        height: 20px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .floating-nav-ball:hover {
        transform: none;
    }

    .floating-nav-ball:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
    }
}

/* 按钮变体 */
.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #1e7e34;
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-disabled,
.btn[disabled] {
    opacity: 0.55;
    pointer-events: none;
    cursor: not-allowed;
}

/* 信息卡片网格 */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.info-card {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: var(--radius-medium);
    border: 1px solid var(--border-light);
}

.info-card h4 {
    margin: 0 0 6px;
    font-size: 14px;
    color: var(--text-secondary);
}

.info-card p {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

/* 状态文字 */
.status-available {
    color: #28a745;
    font-weight: 600;
}

.status-full {
    color: #dc3545;
    font-weight: 600;
}

.room-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2px;
    border: 1px solid transparent;
}

.room-status-badge.status-available {
    color: #0d8e4d;
    background: rgba(7, 193, 96, 0.12);
    border-color: rgba(7, 193, 96, 0.28);
}

.room-status-badge.status-full {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.12);
    border-color: rgba(220, 53, 69, 0.3);
}

/* 警告框 */
.warning-box {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: var(--radius-medium);
    padding: 16px;
    margin: 16px 0;
    color: #856404;
}

[data-theme="dark"] .warning-box {
    background: rgba(255, 193, 7, 0.12);
    border-color: rgba(255, 193, 7, 0.3);
    color: #ffc107;
}

/* 房间列表网格 */
.room-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
    align-items: stretch;
}

/* 空提示卡片 */
.empty-card {
    text-align: center;
    padding: 40px 20px;
}

.empty-card h3 {
    margin: 0 0 8px;
}

.empty-card p {
    color: var(--text-secondary);
    margin: 0 0 16px;
}

/* 房间操作区 */
.room-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
}

.room-quick-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.room-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border-light);
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.room-pill-lock.is-password {
    color: #c05326;
    background: rgba(255, 107, 53, 0.12);
    border-color: rgba(255, 107, 53, 0.3);
}

.room-pill-lock.is-open {
    color: #0d8e4d;
    background: rgba(7, 193, 96, 0.12);
    border-color: rgba(7, 193, 96, 0.28);
}

.room-pill-users.is-full {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.12);
    border-color: rgba(220, 53, 69, 0.3);
}

.room-pill-status.is-available {
    color: #0d8e4d;
    background: rgba(7, 193, 96, 0.12);
    border-color: rgba(7, 193, 96, 0.28);
}

.room-pill-status.is-full {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.12);
    border-color: rgba(220, 53, 69, 0.3);
}

.room-pill-status.is-offline {
    color: #7a3542;
    background: rgba(160, 39, 58, 0.14);
    border-color: rgba(160, 39, 58, 0.28);
}

.room-runtime-pill {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--border-light);
}

.room-runtime-pill.is-online {
    color: #0d8e4d;
    background: rgba(7, 193, 96, 0.12);
    border-color: rgba(7, 193, 96, 0.28);
}

.room-runtime-pill.is-offline {
    color: #7a3542;
    background: rgba(160, 39, 58, 0.14);
    border-color: rgba(160, 39, 58, 0.28);
}

.room-list-card {
    display: flex;
    height: 100%;
}

.room-list-card-body {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 8px;
}

.room-create-btn {
    border-radius: 999px;
    padding-inline: 16px;
    box-shadow: 0 6px 14px rgba(7, 193, 96, 0.2);
}

.room-create-btn:hover {
    box-shadow: 0 8px 18px rgba(7, 193, 96, 0.28);
}

.room-description-text {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
    /* 保留换行但合并多余空白，避免模板缩进影响显示 */
    white-space: pre-line;
    word-break: break-word;
    overflow-wrap: anywhere;
    overflow: hidden;
    transition: max-height 0.26s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.18s ease;
    will-change: max-height;
}

.room-description-empty {
    color: var(--text-light);
    font-style: italic;
}

.room-description-block {
    margin-bottom: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-small);
    padding: 8px 10px;
}

.room-description-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.room-description-label {
    font-size: 12px;
    color: var(--text-light);
    font-weight: 600;
}

.room-description-toggle {
    display: none;
    border: none;
    background: none;
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    align-items: center;
    gap: 4px;
    transition: color 0.18s ease;
}

.room-description-toggle::after {
    content: "▾";
    font-size: 11px;
    line-height: 1;
    transition: transform 0.2s ease;
}

.room-description-toggle.is-expanded::after {
    transform: rotate(180deg);
}

.room-description-toggle.is-disabled {
    color: var(--text-light);
    cursor: default;
}

.room-description-toggle.is-disabled::after {
    content: "";
}

.room-description-text.is-collapsed {
    opacity: 0.92;
}

.room-description-text.is-expanded {
    opacity: 1;
}

.room-detail-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 2px;
}

.room-meta-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-small);
    padding: 6px 8px;
    min-width: 0;
}

.room-meta-label {
    font-size: 11px;
    color: var(--text-light);
    line-height: 1.2;
}

.room-meta-value {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.35;
    word-break: break-word;
}

.room-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    padding-top: 10px;
}

.room-actions-left {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
}

.room-action-btn {
    border-radius: 10px;
    min-width: 68px;
    justify-content: center;
}

.room-action-btn.is-offline-entry {
    background: rgba(160, 39, 58, 0.12);
    border-color: rgba(160, 39, 58, 0.3);
    color: #7a3542;
}

.room-action-btn.is-offline-entry:hover {
    background: rgba(160, 39, 58, 0.2);
}

.room-share-btn {
    border: 1px solid var(--border-color);
}

.room-delete-btn {
    margin-left: 0;
    min-width: 70px;
}

@media (min-width: 561px) and (max-width: 1024px) {
    .room-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .room-detail-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .room-detail-meta {
        grid-template-columns: 1fr;
    }

    .room-actions-row {
        flex-direction: column;
        align-items: stretch;
    }

    .room-actions-left {
        width: 100%;
    }

    .room-delete-btn {
        width: 100%;
    }
}

.copy-success {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 5px 10px;
    border-radius: var(--radius-small);
    font-size: 13px;
    display: none;
}

.share-toast {
    position: fixed;
    right: 14px;
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    z-index: 2100;
    max-width: min(92vw, 360px);
    padding: 11px 14px;
    border-radius: 12px;
    color: #fff;
    font-size: 13px;
    line-height: 1.4;
    box-shadow: var(--shadow-strong);
    opacity: 0;
    transform: translateY(10px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.share-toast.is-success {
    background: linear-gradient(135deg, #119a5d 0%, #0a7e4b 100%);
}

.share-toast.is-error {
    background: linear-gradient(135deg, #c33b4a 0%, #8b2330 100%);
}

.share-toast.is-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

@media (max-width: 560px) {
    .share-toast {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* 分享链接提示 */
.auto-join-notice {
    background: rgba(7, 193, 96, 0.08);
    border: 1px solid rgba(7, 193, 96, 0.2);
    border-radius: var(--radius-medium);
    padding: 12px 16px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* 帮助文字 */
.help-text {
    font-size: 13px;
    color: var(--text-light);
    margin-top: 4px;
}

/* 错误文字 */
.field-error {
    margin-top: 4px;
    font-size: 13px;
    color: var(--accent-color);
}

/* 尺寸双列 */
.size-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* 打印样式 */
@media print {
    .bottom-nav,
    .brand-header,
    .popup-menu,
    .menu-overlay,
    .floating-nav-ball {
        display: none !important;
    }

    .layout {
        padding-bottom: 0;
    }

    .content {
        padding: 0;
        max-width: none;
    }
}
