/* ================= 引入与基础重置 ================= */
@font-face {
    font-family: 'MyCustomFont';
    src: url('font/a.subset.woff2') format('woff2');   
    font-weight: normal;
    font-style: normal;
    font-display: swap;                             
}

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

html {
    font-size: 14px; 
    scroll-behavior: smooth;
}

html.snap-enabled {
    scroll-snap-type: y mandatory;
    overflow-y: scroll;
}

body {
    font-family: 'MyCustomFont', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #000;
    background-color: #fcfcfc;
    overflow-x: hidden;
}

/* ================= 导航栏 ================= */
header {
    width: 100%; padding: 24px 36px; display: flex; justify-content: space-between; align-items: center;
    position: fixed; top: 0; left: 0; z-index: 100;
    background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.logo-area { cursor: pointer; }
.logo-area span { font-size: 1.15rem; font-weight: 700; color: #111; letter-spacing: 0.8px; }
.nav-actions { display: flex; align-items: center; gap: 24px; }
.nav-actions .material-symbols-rounded { font-size: 24px; cursor: pointer; transition: opacity 0.3s; }
.nav-actions .material-symbols-rounded:hover { opacity: 0.5; }

/* ================= 侧边栏 ================= */
.sidebar-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(4px); z-index: 999;
    opacity: 0; visibility: hidden; transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar-overlay.active { opacity: 1; visibility: visible; }

.sidebar {
    position: fixed; top: 0; right: 0; width: 340px; height: 100%;
    background: #fbfbfb; z-index: 1000; box-shadow: -10px 0 30px rgba(0, 0, 0, 0.05);
    transform: translateX(100%); transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex; flex-direction: column;
}
.sidebar.active { transform: translateX(0); }

.sidebar-header { padding: 24px; display: flex; justify-content: space-between; align-items: center; background: #f4f4f4; border-bottom: 1px solid rgba(0,0,0,0.03); }
.sidebar-brand { display: flex; align-items: center; gap: 12px; }
.sidebar-brand img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.sidebar-title { display: flex; flex-direction: column; }
.sidebar-title strong { font-size: 1.1rem; font-weight: 800; color: #111; letter-spacing: 0.5px;}
.sidebar-title span { font-size: 0.8rem; color: #777; font-weight: 500;}
.close-btn { cursor: pointer; color: #555; font-size: 24px; transition: 0.2s;}
.close-btn:hover { color: #000; }

.sidebar-content { padding: 24px; flex: 1; overflow-y: auto; }
.sidebar-section { margin-bottom: 32px; }
.section-label { font-size: 0.85rem; color: #888; margin-bottom: 16px; padding-left: 8px; }
.sidebar-item { display: flex; align-items: center; gap: 16px; padding: 12px; margin-bottom: 8px; border-radius: 12px; cursor: pointer; text-decoration: none; color: #111; font-weight: 500; font-size: 1.05rem; transition: background 0.2s; }
.sidebar-item:hover { background: rgba(0, 0, 0, 0.04); }
.sidebar-item .icon-box { width: 36px; height: 36px; border-radius: 10px; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.04); display: flex; justify-content: center; align-items: center; }
.sidebar-item .material-symbols-rounded { font-size: 20px; color: #555; }

.sidebar-item.btn-register { background: #121212; color: #fff; justify-content: space-between; padding: 14px 16px; margin-top: 16px; }
.sidebar-item.btn-register:hover { background: #333; }
.sidebar-item.btn-register .reg-left { display: flex; align-items: center; gap: 12px; }
.sidebar-item.btn-register .icon-box { background: rgba(255,255,255,0.1); box-shadow: none; }
.sidebar-item.btn-register .material-symbols-rounded { color: #fff; }

.sidebar-footer { padding: 24px; display: flex; justify-content: center; align-items: center; gap: 12px; color: #999; font-size: 0.85rem; }

/* ================= 第一屏主页 ================= */
.snap-section {
    width: 100%; height: 100vh;
    scroll-snap-align: start; scroll-snap-stop: always;
    position: relative; display: flex; flex-direction: column;
    justify-content: center; align-items: center; overflow: hidden;
}
#page1 { background-color: #fcfcfc; padding-top: 80px; }
.hero-container { display: flex; flex-direction: column; align-items: center; width: 100%; }

.title-group { margin-bottom: 48px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.title-logo { width: 80px; height: auto; margin-bottom: 16px; border-radius: 50%; box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.main-title { font-size: 3.2rem; font-weight: 800; color: #000; letter-spacing: -0.5px; margin-bottom: 4px; }
.main-title-cn { font-size: 1.6rem; font-weight: 700; color: #333; margin-bottom: 16px; letter-spacing: 4px; }
.sub-title { font-size: 1.3rem; font-weight: 500; color: #555; margin-bottom: 18px; }
.description { font-size: 0.95rem; color: #666; max-width: 440px; margin: 0 auto; line-height: 1.6; }

.button-group { display: flex; gap: 16px; margin-bottom: 50px; }
.btn { padding: 0 28px; height: 48px; border-radius: 24px; font-size: 1rem; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; transition: all 0.3s ease; border: none; font-family: inherit;}
.btn-primary { background-color: #000; color: #fff; }
.btn-primary:hover { background-color: #333; transform: translateY(-1px); }
.btn-secondary { background: rgba(0, 0, 0, 0.03); color: #000; border: 1px solid rgba(0,0,0,0.1); }
.btn-secondary:hover { background: rgba(0, 0, 0, 0.06); transform: translateY(-1px); }

.badges-container { display: flex; justify-content: center; gap: 24px; border-top: 1px solid rgba(0,0,0,0.06); padding-top: 24px; }
.badge { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; color: #666; font-weight: 500; }
.badge .material-symbols-rounded { color: #28a745; font-size: 18px; }

.scroll-down-indicator {
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 4px; color: #888; cursor: pointer;
    animation: bounceScroll 2.5s infinite cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes bounceScroll { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 12px); } }

/* ================= 第二屏生态与体系 ================= */
#page2 {
    background-color: #fcfcfc;
    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: 40px 40px; padding-top: 40px; padding-bottom: 60px;
}
.section-header { text-align: center; margin-bottom: 36px; }
.section-header .tag { font-size: 0.75rem; letter-spacing: 2px; color: #888; display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 8px; }
.section-header .tag::before, .section-header .tag::after { content: ""; display: block; width: 40px; height: 1px; background-color: #ddd; }
.section-header h2 { font-size: 1.8rem; font-weight: 700; color: #111; }

.bento-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; width: 90%; max-width: 900px; margin: 0 auto; }
.bento-card {
    background: rgba(255, 255, 255, 0.8); border: 1px solid rgba(0, 0, 0, 0.05); border-radius: 16px; padding: 20px;
    backdrop-filter: blur(10px); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02); display: flex; flex-direction: column; gap: 10px;
    opacity: 0; visibility: hidden; transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.bento-grid.in-view .bento-card { opacity: 1; visibility: visible; transform: translate(0, 0) !important; }
.bento-card:nth-child(1) { transform: translate(-30px, -30px); transition-delay: 0.1s; grid-column: span 2; }
.bento-card:nth-child(2) { transform: translateY(-30px); transition-delay: 0.2s; grid-column: span 1; }
.bento-card:nth-child(3) { transform: translate(30px, -30px); transition-delay: 0.3s; grid-column: span 1; }
.bento-card:nth-child(4) { transform: translate(-30px, 0); transition-delay: 0.4s; grid-column: span 2; }
.bento-card:nth-child(5) { transform: translate(30px, 0); transition-delay: 0.5s; grid-column: span 2; }
.bento-card:nth-child(6) { transform: translate(-30px, 30px); transition-delay: 0.6s; grid-column: span 1; }
.bento-card:nth-child(7) { transform: translateY(30px); transition-delay: 0.7s; grid-column: span 1; }
.bento-card:nth-child(8) { transform: translate(30px, 30px); transition-delay: 0.8s; grid-column: span 2; }

.card-icon { width: 32px; height: 32px; border-radius: 8px; background: #f0f0f0; display: flex; justify-content: center; align-items: center; margin-bottom: 2px; }
.card-icon .material-symbols-rounded { font-size: 18px; color: inherit; }
.card-title { font-size: 1.05rem; font-weight: 700; color: #111; display: flex; align-items: center; gap: 8px; }
.card-desc { font-size: 0.8rem; color: #666; line-height: 1.6; }

.main-footer { position: absolute; bottom: 20px; left: 0; width: 100%; text-align: center; display: flex; flex-direction: column; gap: 6px; }
.main-footer .contact-info { font-size: 0.9rem; color: #666; font-weight: 500; }
.main-footer .sponsor-info { font-size: 0.75rem; color: #aaa; }

/* ================= 身份验证弹窗 (登录/注册) ================= */
.auth-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(245, 245, 247, 0.8); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    z-index: 2000; display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden; transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.auth-overlay.active { opacity: 1; visibility: visible; }
.auth-container {
    position: relative; width: 100%; max-width: 440px; background: #ffffff; border-radius: 24px; padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0,0,0,0.02);
    transform: translateY(40px) scale(0.95); transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    max-height: 90vh; overflow-y: auto;
}
.auth-overlay.active .auth-container { transform: translateY(0) scale(1); }

.close-auth-btn {
    position: absolute; top: 20px; right: 20px; font-size: 24px; color: #999; cursor: pointer; transition: 0.2s; background: #f5f5f5; border-radius: 50%; padding: 4px;
}
.close-auth-btn:hover { color: #000; background: #e5e5e5; }

.auth-header { text-align: center; margin-bottom: 24px; }
.auth-logo { width: 56px; height: 56px; border-radius: 50%; margin-bottom: 16px; }
.auth-header h2 { font-size: 1.4rem; font-weight: 700; color: #111; margin-bottom: 6px; }
.auth-header p { font-size: 0.9rem; color: #777; }

.auth-tabs { display: flex; position: relative; background: #f0f0f0; border-radius: 12px; padding: 4px; margin-bottom: 24px; }
.auth-tab { flex: 1; text-align: center; padding: 10px 0; font-size: 0.95rem; font-weight: 600; color: #666; cursor: pointer; position: relative; z-index: 2; transition: 0.3s; }
.auth-tab.active { color: #000; }
.tab-indicator {
    position: absolute; top: 4px; left: 4px; width: calc(50% - 4px); height: calc(100% - 8px);
    background: #fff; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); z-index: 1;
}

.auth-form { display: none; animation: fadeIn 0.4s ease; }
.auth-form.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.input-group { position: relative; margin-bottom: 16px; }
.input-group .material-symbols-rounded { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: #aaa; font-size: 20px; transition: 0.3s; }
.input-group input {
    width: 100%; height: 50px; background: #f9f9f9; border: 1px solid #eee; border-radius: 12px;
    padding: 0 16px 0 46px; font-size: 1rem; color: #333; font-family: inherit; transition: 0.3s; outline: none;
}
.input-group input:focus { background: #fff; border-color: #000; box-shadow: 0 0 0 4px rgba(0,0,0,0.03); }
.input-group input:focus + .material-symbols-rounded { color: #000; }
.input-group.with-btn input { padding-right: 110px; }
.btn-get-code {
    position: absolute; right: 6px; top: 6px; height: 38px; padding: 0 12px; background: #fff; border: 1px solid #ddd; border-radius: 8px; font-size: 0.85rem; font-weight: 600; color: #333; cursor: pointer; transition: 0.2s; font-family: inherit;
}
.btn-get-code:hover { background: #f0f0f0; border-color: #ccc; }

.btn-auth-submit {
    width: 100%; height: 50px; margin-top: 12px; font-size: 1.05rem; border-radius: 12px; background-color: #000; color: #fff; border: none; font-weight: 600; cursor: pointer; transition: 0.3s;
}
.btn-auth-submit:hover { background-color: #333; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }

/* ================= 控制台 Dashboard (console.php) ================= */
.console-main {
    min-height: 100vh;
    padding-top: 120px;
    padding-bottom: 60px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.dashboard-container {
    width: 100%; max-width: 1000px;
    display: flex; flex-direction: column; gap: 20px;
    padding: 0 20px; 
    animation: fadeIn 0.6s ease;
}

.dashboard-card {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex; flex-direction: column; justify-content: center;
}
.dashboard-card:hover { transform: translateY(-2px); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.06); }

.card-full-width { width: 100%; }
.text-center { text-align: center; align-items: center; }

.dashboard-card h3 { font-size: 1.8rem; font-weight: 700; color: #111; margin-bottom: 12px; letter-spacing: -0.5px;}
.dashboard-card p { font-size: 1rem; color: #666; margin-bottom: 24px; }
.btn-create-agent { padding: 0 40px; height: 48px; border-radius: 24px; font-size: 1.05rem; font-weight: 600; font-family: inherit; }

.dashboard-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; width: 100%; }

.card-title-sm { font-size: 1.05rem; font-weight: 700; color: #111; display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.card-title-sm .material-symbols-rounded { font-size: 20px; color: #555; }

.stat-flex { display: flex; align-items: center; justify-content: space-between; background: rgba(0,0,0,0.02); border-radius: 16px; padding: 16px; }
.stat-box { display: flex; flex-direction: column; align-items: center; flex: 1; }
.stat-num { font-size: 1.6rem; font-weight: 800; color: #111; margin-bottom: 4px; }
.stat-desc { font-size: 0.8rem; color: #777; }
.stat-divider { width: 1px; height: 30px; background: rgba(0,0,0,0.06); }
.text-green { color: #28a745 !important; }

.usage-text { font-size: 0.95rem; color: #555; margin-bottom: 16px !important; }
.usage-text strong { color: #111; font-size: 1.1rem; }
.progress-bg { width: 100%; height: 10px; background: #eee; border-radius: 10px; overflow: hidden; margin-bottom: 8px; }
.progress-fill { height: 100%; background: #28a745; border-radius: 10px; }
.progress-text { text-align: right; font-size: 0.85rem; color: #28a745; font-weight: 700; }

.invite-code { font-size: 0.9rem; color: #555; margin-bottom: 16px; background: rgba(0,0,0,0.03); padding: 10px 16px; border-radius: 12px;}
.invite-code strong { color: #111; letter-spacing: 1px; font-size: 1rem;}

.btn-logout { color: #d32f2f !important; }
.btn-logout:hover { background: rgba(211, 47, 47, 0.06) !important; }
.btn-logout .icon-box { background: rgba(211, 47, 47, 0.1) !important; box-shadow: none !important; }
.btn-logout .material-symbols-rounded { color: #d32f2f !important; }

/* ================= 通用弹窗组件 (Modal) ================= */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(245, 245, 247, 0.7); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    z-index: 2000; display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden; transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-container {
    position: relative; width: 90%; max-width: 500px;
    background: #ffffff; border-radius: 24px; padding: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0,0,0,0.02);
    transform: translateY(30px) scale(0.95); transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    max-height: 85vh; display: flex; flex-direction: column;
}
.modal-container.modal-large { max-width: 800px; }
.modal-overlay.active .modal-container { transform: translateY(0) scale(1); }

.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 24px 32px; border-bottom: 1px solid rgba(0,0,0,0.05);
}
.modal-title { font-size: 1.25rem; font-weight: 700; color: #111; display: flex; align-items: center; gap: 8px; }
.modal-title .material-symbols-rounded { font-size: 24px; color: #555; }
.modal-close-btn { font-size: 24px; color: #999; cursor: pointer; transition: 0.2s; background: #f5f5f5; border-radius: 50%; padding: 6px; }
.modal-close-btn:hover { color: #000; background: #e5e5e5; }

.modal-body { padding: 32px; overflow-y: auto; flex: 1; }
/* 弹窗：自定义大圆角搜索区域 (内嵌式 iOS 精致风格) */
.custom-search-bar {
    display: flex;
    align-items: center;
    background: #f5f5f7;
    border: 1px solid rgba(0,0,0,0.04);
    border-radius: 24px;
    /* 去掉死板的 height: 48px，改为 min-height 保证不溢出 */
    min-height: 48px; 
    padding: 4px 4px 4px 20px;
    margin-bottom: 24px;
    transition: all 0.3s ease;
    width: 100%; /* 确保限制在弹窗内 */
    box-sizing: border-box;
}
.custom-search-bar:focus-within {
    background: #fff;
    border-color: #d1d1d6;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
}
.custom-search-input {
    flex: 1;
    /* 核心修复：防止 input 撑破 flex 容器 */
    min-width: 0; 
    width: 100%;
    padding-right: 12px; /* 与右侧按钮保持呼吸感 */
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.95rem;
    color: #111;
    font-family: inherit;
}
.custom-search-input::placeholder { color: #999; }
.custom-search-btn {
    height: 40px;
    padding: 0 20px;
    border-radius: 20px;
    background: #111;
    color: #fff;
    border: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
    font-family: inherit;
    /* 核心：保证按钮自身大小不被挤压 */
    flex-shrink: 0; 
}
.custom-search-btn:hover { background: #333; }
.custom-search-btn .material-symbols-rounded { font-size: 18px; }

/* 针对移动端极小屏幕的容错处理 */
@media (max-width: 480px) {
    .custom-search-bar { padding: 4px 4px 4px 16px; }
    .custom-search-btn { padding: 0 16px; }
}


/* 弹窗：人格列表区域 (整体瘦身，更加紧凑) */
.persona-list { display: flex; flex-direction: column; gap: 10px; }

.persona-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; border-radius: 12px; border: 1px solid rgba(0,0,0,0.04);
    background: #fff; transition: all 0.2s ease;
}
.persona-item:hover {
    border-color: rgba(0,0,0,0.1); box-shadow: 0 4px 12px rgba(0,0,0,0.03); transform: translateY(-1px);
}

.persona-info-area { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; }
.persona-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(0,0,0,0.05); flex-shrink: 0; }
.persona-text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.persona-name { font-size: 1rem; font-weight: 600; color: #111; }
.persona-desc {
    font-size: 0.8rem; color: #777; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 95%;
}

.persona-actions-area { display: flex; gap: 8px; flex-shrink: 0; margin-left: 12px; }

/* 优化后的小按钮样式 */
.btn-small {
    height: 32px; padding: 0 14px; border-radius: 16px; font-size: 0.8rem; font-weight: 500;
    cursor: pointer; transition: all 0.2s; font-family: inherit; display: flex; align-items: center; justify-content: center;
}
.btn-outline { background: transparent; border: 1px solid #ddd; color: #333; }
.btn-outline:hover { border-color: #111; color: #111; background: rgba(0,0,0,0.02); }
.btn-black { background: #111; border: none; color: #fff; }
.btn-black:hover { background: #333; }

/* 弹窗：完整人设内容 */
.persona-detail-content { background: #f9f9f9; padding: 24px; border-radius: 16px; border: 1px solid rgba(0,0,0,0.04); }

/* ================= 响应式 ================= */
@media (max-width: 900px) {
    .bento-grid { grid-template-columns: repeat(2, 1fr); max-width: 100%; }
    .bento-card { grid-column: span 2 !important; }
    #page2 { height: auto; padding-bottom: 100px; scroll-snap-align: none; }
    .main-footer { bottom: 30px; }
    html.snap-enabled { scroll-snap-type: none; }
    .sidebar { width: 85%; }
    .main-title { font-size: 2.6rem; }
    .main-title-cn { font-size: 1.4rem; letter-spacing: 2px; }
    .sub-title { font-size: 1.15rem; }
    .auth-container { padding: 30px 20px; border-radius: 20px; width: 90%; }
    .auth-header h2 { font-size: 1.2rem; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-card { padding: 24px; }
}

/* 弹窗响应式微调 */
@media (max-width: 768px) {
    .modal-container { width: 95%; max-height: 90vh;}
    .modal-header { padding: 16px 20px; }
    .modal-body { padding: 16px 20px; }
    
    .persona-item { flex-direction: column; align-items: flex-start; gap: 12px; }
    .persona-desc { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; max-width: 100%;}
    .persona-actions-area { width: 100%; justify-content: flex-end; margin-left: 0;}
}
/* ================= 新增：用量信息卡片特殊布局 ================= */
.usage-balance { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px dashed rgba(0,0,0,0.08); font-size: 0.95rem; color: #555; }
.usage-balance strong { font-size: 1.15rem; color: #111; }

/* ================= 新增：多步工作流 (Step Wrapper) ================= */
.step-wrapper { position: relative; min-height: 350px; display: flex; flex-direction: column; justify-content: center; }
.step-content { display: none; animation: fadeIn 0.4s ease; width: 100%; }
.step-content.active { display: block; }
.step-title { font-size: 1.6rem; font-weight: 700; color: #111; margin-bottom: 12px; text-align: center; }
.step-desc { font-size: 0.95rem; color: #666; text-align: center; margin-bottom: 32px; line-height: 1.6; }

.step-actions-vertical { display: flex; flex-direction: column; gap: 16px; align-items: center; }
.btn-large { width: 100%; max-width: 320px; height: 56px; border-radius: 28px; font-size: 1.1rem; font-weight: 600; cursor: pointer; transition: all 0.3s; font-family: inherit; display: flex; justify-content: center; align-items: center; gap: 8px; margin: 0 auto;}
.or-divider { width: 100%; max-width: 320px; text-align: center; position: relative; margin: 8px 0; }
.or-divider::before { content: ""; position: absolute; left: 0; top: 50%; width: 100%; height: 1px; background: rgba(0,0,0,0.06); z-index: 1; }
.or-divider span { position: relative; z-index: 2; background: #fff; padding: 0 12px; font-size: 0.85rem; color: #999; }

/* ================= 新增：精美表单组件 ================= */
.form-group { margin-bottom: 20px; text-align: left; }
.form-group label { display: block; font-size: 0.95rem; font-weight: 600; color: #333; margin-bottom: 8px; }
.hint-text { font-size: 0.8rem; font-weight: normal; color: #888; }
.form-group-flex { display: flex; gap: 16px; }
.form-group-flex .form-group { flex: 1; }

.custom-input, .custom-textarea, .custom-select {
    width: 100%; background: #f5f5f7; border: 1px solid rgba(0,0,0,0.04); border-radius: 12px;
    padding: 14px 16px; font-size: 1rem; color: #111; font-family: inherit; transition: all 0.3s ease; outline: none; box-sizing: border-box;
}
.custom-textarea { resize: vertical; line-height: 1.5; }
.custom-input:focus, .custom-textarea:focus, .custom-select:focus {
    background: #fff; border-color: #111; box-shadow: 0 0 0 4px rgba(0,0,0,0.04);
}
.custom-select { appearance: none; background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 16px center; background-size: 16px; padding-right: 40px; cursor: pointer; }

/* 定制单选框 (Radio) */
.radio-group { display: flex; gap: 24px; margin-top: 8px; }
.radio-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.95rem; color: #333; }
.radio-label input { display: none; }
.radio-custom { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #ccc; display: inline-block; position: relative; transition: 0.2s; }
.radio-label input:checked + .radio-custom { border-color: #111; }
.radio-label input:checked + .radio-custom::after { content: ""; position: absolute; width: 10px; height: 10px; background: #111; border-radius: 50%; top: 50%; left: 50%; transform: translate(-50%, -50%); }

/* ================= 新增：二维码与动画组件 ================= */
.qr-placeholder { width: 200px; height: 200px; background: #f0f0f0; border-radius: 16px; display: flex; flex-direction: column; justify-content: center; align-items: center; margin: 24px auto; }
.spinner { width: 40px; height: 40px; border: 4px solid rgba(0,0,0,0.1); border-top-color: #111; border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 绿色完美对勾动画 */
.success-animation { margin: 20px auto; }
.checkmark { width: 80px; height: 80px; border-radius: 50%; display: block; stroke-width: 2; stroke: #28a745; stroke-miterlimit: 10; margin: 0 auto; box-shadow: inset 0px 0px 0px #28a745; animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both; }
.checkmark__circle { stroke-dasharray: 166; stroke-dashoffset: 166; stroke-width: 2; stroke-miterlimit: 10; stroke: #28a745; fill: none; animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards; }
.checkmark__check { transform-origin: 50% 50%; stroke-dasharray: 48; stroke-dashoffset: 48; animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards; }
@keyframes stroke { 100% { stroke-dashoffset: 0; } }
@keyframes scale { 0%, 100% { transform: none; } 50% { transform: scale3d(1.1, 1.1, 1); } }
@keyframes fill { 100% { box-shadow: inset 0px 0px 0px 40px #28a745; } }

/* ================= 新增：智能体管理专属卡片 ================= */
.agent-management-card { padding: 40px; text-align: left; }
.agent-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid rgba(0,0,0,0.05); }
.agent-title-area { display: flex; align-items: center; gap: 16px; }
.agent-title-area h3 { margin: 0; font-size: 1.6rem; }
.agent-status { padding: 4px 12px; border-radius: 12px; font-size: 0.85rem; font-weight: 600; }
.agent-status.active { background: #e8f5e9; color: #2e7d32; }
.agent-status.stopped { background: #ffebee; color: #c62828; }
.agent-id { font-family: monospace; font-size: 0.95rem; color: #888; background: #f5f5f5; padding: 4px 10px; border-radius: 8px; }

.agent-config-row { display: flex; gap: 24px; margin-bottom: 32px; }
.agent-config-row .config-item { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.agent-config-row label { font-size: 0.9rem; font-weight: 600; color: #555; }

.agent-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-action { height: 44px; padding: 0 20px; border-radius: 12px; background: #f5f5f7; border: 1px solid rgba(0,0,0,0.04); font-size: 0.95rem; font-weight: 600; color: #333; display: flex; align-items: center; gap: 6px; cursor: pointer; transition: all 0.2s; font-family: inherit;}
.btn-action:hover { background: #ebebeb; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.04); }
.btn-action .material-symbols-rounded { font-size: 20px; }
.btn-danger { color: #d32f2f; background: rgba(211, 47, 47, 0.05); border-color: rgba(211, 47, 47, 0.1); }
.btn-danger:hover { background: rgba(211, 47, 47, 0.1); }
.btn-success { color: #2e7d32; background: rgba(46, 125, 50, 0.05); border-color: rgba(46, 125, 50, 0.1); }
.btn-success:hover { background: rgba(46, 125, 50, 0.1); }

/* ================= 新增：聊天气泡组件 ================= */
.chat-bubble { display: flex; gap: 12px; margin-bottom: 20px; width: 100%; }
.chat-bubble.right { flex-direction: row-reverse; }
.chat-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.chat-avatar.user { background: #111; color: #fff; display: flex; justify-content: center; align-items: center; font-weight: bold; font-size: 1.2rem; }
.chat-text { max-width: 70%; padding: 14px 18px; border-radius: 20px; font-size: 0.95rem; line-height: 1.5; color: #111; }
.chat-bubble.left .chat-text { background: #fff; border-top-left-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,0.02); border: 1px solid rgba(0,0,0,0.04);}
.chat-bubble.right .chat-text { background: #dcf8c6; border-top-right-radius: 4px; border: 1px solid rgba(0,0,0,0.04); }

/* 响应式微调 */
@media (max-width: 768px) {
    .agent-header { flex-direction: column; align-items: flex-start; gap: 16px; }
    .agent-config-row { flex-direction: column; }
    .form-group-flex { flex-direction: column; }
}


/* ================= 紧凑型控制台 Dashboard 布局 ================= */
.console-main {
    min-height: 100vh;
    padding-top: 100px;
    padding-bottom: 60px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.dashboard-container {
    width: 100%; 
    max-width: 850px; /* 严格限制宽度，禁止占满全屏 */
    display: flex; flex-direction: column; gap: 16px;
    padding: 0 16px; 
    animation: fadeIn 0.6s ease;
}

.dashboard-card {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    padding: 24px; /* 减小内边距，使排版紧凑 */
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.03);
    display: flex; flex-direction: column; justify-content: center;
}
.card-full-width { width: 100%; }
.text-center { text-align: center; align-items: center; }

.dashboard-card h3 { font-size: 1.5rem; font-weight: 700; color: #111; margin-bottom: 8px;}
.dashboard-card p { font-size: 0.95rem; color: #666; margin-bottom: 16px; }
.btn-create-agent { padding: 0 32px; height: 44px; border-radius: 22px; font-size: 1rem; font-weight: 600; font-family: inherit; }

.dashboard-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; width: 100%; }

/* ================= 智能体管理专属卡片 (紧凑型) ================= */
.agent-management-card { padding: 24px; text-align: left; }
.agent-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid rgba(0,0,0,0.05); }

.agent-title-area { display: flex; align-items: center; gap: 12px; }
.agent-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 1px solid rgba(0,0,0,0.05); }
.agent-id-box { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.agent-id-box h3 { font-size: 1.25rem; margin: 0; letter-spacing: 0; color: #111; }

.agent-status { padding: 4px 10px; border-radius: 8px; font-size: 0.75rem; font-weight: 600; }
.agent-status.active { background: #e8f5e9; color: #2e7d32; }
.agent-status.stopped { background: #ffebee; color: #c62828; }

.agent-config-row { display: flex; gap: 16px; margin-bottom: 24px; }
.agent-config-row .config-item { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.agent-config-row label { font-size: 0.85rem; font-weight: 600; color: #555; }

/* ================= 纯 CSS 通用精美下拉框 ================= */
.universal-css-select {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    width: 100%; background: #f9f9f9; border: 1px solid rgba(0,0,0,0.08); border-radius: 10px;
    padding: 10px 14px; font-size: 0.95rem; color: #111; font-family: inherit; cursor: pointer; outline: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
    padding-right: 36px; transition: 0.2s; box-sizing: border-box;
}
.universal-css-select:focus { background: #fff; border-color: #111; box-shadow: 0 0 0 3px rgba(0,0,0,0.04); }

/* ================= 紧凑型操作按钮 ================= */
.agent-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-action { height: 36px; padding: 0 14px; border-radius: 8px; background: #f5f5f7; border: 1px solid rgba(0,0,0,0.04); font-size: 0.85rem; font-weight: 600; color: #333; display: flex; align-items: center; gap: 4px; cursor: pointer; transition: all 0.2s; font-family: inherit;}
.btn-action:hover { background: #ebebeb; transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.btn-action .material-symbols-rounded { font-size: 18px; }
.btn-danger { color: #d32f2f; background: rgba(211, 47, 47, 0.05); border-color: rgba(211, 47, 47, 0.1); }
.btn-danger:hover { background: rgba(211, 47, 47, 0.1); }
.btn-success { color: #2e7d32; background: rgba(46, 125, 50, 0.05); border-color: rgba(46, 125, 50, 0.1); }
.btn-success:hover { background: rgba(46, 125, 50, 0.1); }

/* ================= 数据统计微调 ================= */
.card-title-sm { font-size: 1rem; font-weight: 700; color: #111; display: flex; align-items: center; gap: 6px; margin-bottom: 12px; }
.card-title-sm .material-symbols-rounded { font-size: 18px; color: #555; }
.stat-flex { display: flex; align-items: center; justify-content: space-between; background: rgba(0,0,0,0.02); border-radius: 12px; padding: 12px; }
.stat-box { display: flex; flex-direction: column; align-items: center; flex: 1; }
.stat-num { font-size: 1.4rem; font-weight: 800; color: #111; margin-bottom: 2px; }
.stat-desc { font-size: 0.75rem; color: #777; }
.stat-divider { width: 1px; height: 24px; background: rgba(0,0,0,0.06); }
.text-green { color: #28a745 !important; }

/* 用量信息 */
.usage-text { font-size: 0.85rem; color: #555; margin-bottom: 12px !important; }
.usage-text strong { color: #111; font-size: 0.95rem; }
.progress-bg { width: 100%; height: 8px; background: #eee; border-radius: 8px; overflow: hidden; margin-bottom: 6px; }
.progress-fill { height: 100%; background: #28a745; border-radius: 8px; }
.progress-text { text-align: right; font-size: 0.8rem; color: #28a745; font-weight: 700; }
.usage-balance { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px dashed rgba(0,0,0,0.08); font-size: 0.85rem; color: #555; }
.usage-balance strong { font-size: 1rem; color: #111; }
.invite-code { font-size: 0.85rem; color: #555; margin-bottom: 12px; background: rgba(0,0,0,0.03); padding: 8px 12px; border-radius: 8px;}
.invite-code strong { color: #111; letter-spacing: 1px; font-size: 0.95rem;}

/* ================= 修复版：完美纯 CSS 绿色对勾动画 ================= */
.pure-css-check {
    width: 60px; height: 60px; border-radius: 50%; border: 3px solid #28a745;
    position: relative; margin: 20px auto; display: block;
}
.pure-css-check::after {
    content: ""; position: absolute; left: 14px; top: 26px;
    width: 20px; height: 10px; border-left: 3px solid #28a745; border-bottom: 3px solid #28a745;
    transform: rotate(-45deg); transform-origin: top left;
    opacity: 0; animation: drawCheck 0.4s ease 0.2s forwards;
}
@keyframes drawCheck {
    0% { width: 0; height: 0; opacity: 1; }
    50% { width: 0; height: 10px; opacity: 1; }
    100% { width: 20px; height: 10px; opacity: 1; }
}

/* ================= 各种表单与卡片内组件小修 ================= */
.card-icon-sm { width: 28px; height: 28px; border-radius: 6px; background: #f0f0f0; display: flex; justify-content: center; align-items: center; margin-bottom: 2px; }
.card-icon-sm .material-symbols-rounded { font-size: 16px; color: inherit; }

@media (max-width: 900px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .agent-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .agent-config-row { flex-direction: column; gap: 12px; }
}
/* ================= 纯 CSS 自定义下拉搜索框 ================= */
.custom-dropdown {
    position: relative;
    width: 100%;
}

/* 默认展示区 (模拟 Select 外观) */
.dropdown-selected {
    width: 100%;
    background: #f5f5f7;
    border: 1px solid rgba(0,0,0,0.04);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.95rem;
    color: #111;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    user-select: none;
}
.dropdown-selected:hover {
    background: #fff;
    border-color: #d1d1d6;
}
.dropdown-selected .selected-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}
.dropdown-selected .material-symbols-rounded {
    color: #555;
    font-size: 20px;
    transition: transform 0.3s ease;
}

/* 下拉菜单面板 */
.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    z-index: 100;
    
    /* 动画与隐藏状态 */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.custom-dropdown .dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 当面板打开时，翻转箭头 */
.custom-dropdown:has(.dropdown-menu.active) .dropdown-selected .material-symbols-rounded {
    transform: rotate(180deg);
}

/* 面板内搜索区域 */
.dropdown-search {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}
.dropdown-search .material-symbols-rounded {
    color: #999;
    font-size: 18px;
    margin-right: 8px;
}
.dropdown-search input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.95rem;
    color: #111;
    font-family: inherit;
}

/* 面板内列表区域 */
.dropdown-list {
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
}
.dropdown-list::-webkit-scrollbar {
    width: 6px;
}
.dropdown-list::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
}
.dropdown-item {
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #333;
    transition: background 0.2s;
}
.dropdown-item:hover {
    background: rgba(0,0,0,0.04);
    color: #000;
}
/* ================= 视图路由切换机制 ================= */
.view-section {
    display: none;
    width: 100%;
}
.view-section.active {
    display: block;
    /* 实现如“划过去”般的新页面滑入动画 */
    animation: slideInView 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes slideInView {
    0% { opacity: 0; transform: translateX(30px); }
    100% { opacity: 1; transform: translateX(0); }
}

/* ================= 充值页面 (Recharge View) 样式 ================= */

/* 顶部返回头部 */
.recharge-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}
.recharge-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0;
}
.btn-back {
    background: #f5f5f7;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 20px;
    padding: 8px 16px 8px 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    font-family: inherit;
}
.btn-back:hover {
    background: #e8e8ea;
}
.btn-back .material-symbols-rounded {
    font-size: 20px;
}

/* 余额充值区块 */
.recharge-block {
    margin-bottom: 40px;
}
.balance-input-area {
    display: flex;
    gap: 16px;
    align-items: center;
    max-width: 500px;
}
.currency-input-wrapper {
    position: relative;
    flex: 1;
}
.currency-symbol {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    font-weight: 600;
    color: #111;
}
.amount-input {
    padding-left: 36px !important;
    font-size: 1.1rem;
    font-weight: 600;
}
.btn-recharge {
    padding: 0 32px;
    height: 50px;
    border-radius: 12px;
    font-size: 1.05rem;
}

/* 套餐网格区域 */
.plan-section-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: #111;
}

.plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* 独立的定价卡片 */
.plan-card {
    background: #fff;
    border-radius: 20px;
    border: 1px solid rgba(0,0,0,0.06);
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
}
.plan-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.06);
}

/* 带有赠送福利的卡片 */
.highlight-card {
    border-color: rgba(255, 215, 0, 0.4);
}
.bonus-tag {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #fff8e1;
    color: #f57f17;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 10px;
    border: 1px solid #ffe0b2;
    z-index: 2;
}

/* 套餐头部颜色区分 */
.plan-header {
    padding: 24px;
    color: #fff;
}
.plus-bg { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.pro-bg { background: linear-gradient(135deg, #1e1e1e, #434343); }

.plan-name {
    font-size: 1.1rem;
    font-weight: 600;
    opacity: 0.9;
    margin-bottom: 8px;
}
.plan-price {
    font-size: 2.2rem;
    font-weight: 800;
}
.plan-price span {
    font-size: 1rem;
    font-weight: normal;
    opacity: 0.8;
}

/* 套餐详情内容 */
.plan-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.plan-features {
    list-style: none;
    margin-bottom: 24px;
    flex: 1;
}
.plan-features li {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 0.95rem;
    color: #555;
}
.plan-features li .material-symbols-rounded {
    font-size: 18px;
    color: #111;
}
.plan-features li strong {
    color: #111;
}

.btn-plan-select {
    width: 100%;
    height: 44px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: 0.2s;
}

/* ================= 响应式调整 ================= */
@media (max-width: 768px) {
    .balance-input-area {
        flex-direction: column;
        max-width: 100%;
    }
    .currency-input-wrapper {
        width: 100%;
    }
    .btn-recharge {
        width: 100%;
    }
    .plan-grid {
        grid-template-columns: 1fr;
    }
}
