/* 88连平台 - 通用样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --primary-light: #e8f0fe;
    --bg: #f8f9fa;
    --card-bg: #fff;
    --border: #dadce0;
    --text: #202124;
    --text-light: #5f6368;
    --danger: #ea4335;
    --success: #34a853;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: var(--bg); color: var(--text); line-height: 1.6;
    -webkit-font-smoothing: antialiased; min-height: 100vh;
}

/* Header */
.header { background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%); color: #fff; position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow); }
.header-inner { max-width: 960px; margin: 0 auto; padding: 0 16px; height: 56px; display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; color: #fff; text-decoration: none; }
.logo-icon { font-size: 24px; }
.logo-img { width: 28px; height: 28px; vertical-align: middle; border-radius: 6px; }
h1 .logo-img { width: 36px; height: 36px; }
.header-nav { display: flex; gap: 12px; align-items: center; }
.header-nav a { color: #fff; text-decoration: none; font-size: 14px; }
.header-nav .biz-coop { background: rgba(255,255,255,0.15); padding: 5px 14px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.4); font-size: 13px; }
.header-nav .biz-coop:hover { background: rgba(255,255,255,0.3); }
.modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.modal-content { background: #fff; border-radius: var(--radius); padding: 32px; max-width: 400px; width: 90%; text-align: center; box-shadow: var(--shadow-lg); }
.modal-content h3 { font-size: 20px; margin-bottom: 12px; }
.modal-icon { font-size: 48px; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 12px; justify-content: center; margin-top: 16px; }
.header-nav .user-info { background: rgba(255,255,255,0.2); padding: 4px 12px; border-radius: 20px; font-size: 13px; display: inline-block; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.header-nav .user-info.balance { max-width: none; }
.header-nav .balance { color: #ffd700; font-weight: 600; }

/* Hero */
.hero { background: linear-gradient(135deg, #1a73e8 0%, #4285f4 100%); color: #fff; text-align: center; padding: 48px 20px; }
.slogan { font-size: 28px; font-weight: 700; margin-bottom: 12px; }
.intro { font-size: 15px; opacity: 0.9; max-width: 600px; margin: 0 auto; }

/* Sections */
.agents-section, .messages-section { max-width: 960px; margin: 0 auto; padding: 32px 16px; }
.section-title { font-size: 20px; font-weight: 700; margin-bottom: 20px; }

/* Category Tabs */
.category-tabs { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.category-tab { padding: 8px 20px; border-radius: 20px; border: 1.5px solid var(--border); background: var(--card-bg); color: var(--text-light); font-size: 14px; cursor: pointer; transition: all 0.2s; font-family: inherit; }
.category-tab:hover { border-color: var(--primary); color: var(--primary); }
.category-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

/* Agent Grid */
.agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.agent-card { background: var(--card-bg); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); cursor: pointer; transition: all 0.2s; border: 2px solid transparent; text-decoration: none; color: var(--text); display: block; }
.agent-card:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.agent-card .agent-icon { font-size: 40px; margin-bottom: 12px; position: relative; }
.agent-card .agent-cat-badge { position: absolute; right: 0; top: 4px; font-size: 11px; padding: 3px 10px; border-radius: 12px; line-height: 1; }
.agent-card .agent-cat-badge.tool { background: #e8f0fe; color: var(--primary); }
.agent-card .agent-cat-badge.game { background: #fff3e0; color: #e65100; }
.agent-card .agent-name { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.agent-card .agent-desc { font-size: 13px; color: var(--text-light); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.agent-card .agent-price { margin-top: 12px; font-size: 12px; color: var(--primary); }
.agent-card .free-badge { display: inline-block; background: #e6f4ea; color: var(--success); padding: 2px 8px; border-radius: 12px; font-size: 11px; margin-right: 4px; }
.agent-card .free-badge.forever { background: linear-gradient(90deg,#ff9d2e,#ff5252); color: #fff; font-weight: 600; }

/* Messages */
.message-input-area { margin-bottom: 20px; }
.message-input-area textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; resize: vertical; font-family: inherit; margin-bottom: 8px; }
.message-list { display: flex; flex-direction: column; gap: 12px; }
.message-item { background: var(--card-bg); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.message-item .msg-nickname { font-weight: 600; font-size: 14px; color: var(--primary); }
.message-item .msg-time { font-size: 12px; color: var(--text-light); margin-left: 8px; }
.message-item .msg-content { margin-top: 8px; font-size: 14px; }
.message-item .msg-reply { margin-top: 12px; padding: 10px 12px; background: var(--primary-light); border-radius: 8px; font-size: 13px; }
.message-item .msg-reply::before { content: "管理员回复："; font-weight: 600; color: var(--primary); }
.message-item .no-reply { margin-top: 8px; font-size: 12px; color: var(--text-light); font-style: italic; }

/* Buttons */
.btn-primary { background: var(--primary); color: #fff; border: none; padding: 8px 20px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: #fff; color: var(--text); border: 1px solid var(--border); padding: 8px 16px; border-radius: 8px; font-size: 14px; cursor: pointer; }
.btn-secondary:hover { background: var(--bg); }
.btn-large { width: 100%; padding: 14px; font-size: 16px; border-radius: var(--radius); }

/* Auth pages */
.auth-container { max-width: 400px; margin: 60px auto; background: var(--card-bg); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.auth-container h1 { text-align: center; margin-bottom: 24px; font-size: 24px; }
.auth-form .form-group { margin-bottom: 16px; }
.auth-form label { display: block; font-size: 13px; font-weight: 600; color: var(--text-light); margin-bottom: 6px; }
.auth-form input { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; }
.auth-form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,115,232,0.1); }
.auth-link { text-align: center; margin-top: 16px; font-size: 14px; }
.auth-link a { color: var(--primary); text-decoration: none; }

/* Footer */
.footer { text-align: center; padding: 24px; color: var(--text-light); font-size: 13px; }

/* Loading */
.loading-text { text-align: center; color: var(--text-light); padding: 40px; }

/* Profile */
.profile-container { max-width: 800px; margin: 32px auto; padding: 0 16px; }
.profile-card { background: var(--card-bg); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 16px; }
.profile-card h3 { font-size: 18px; margin-bottom: 16px; }
.info-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #eee; font-size: 14px; }
.info-row:last-child { border-bottom: none; }
.info-row .label { color: var(--text-light); }
.info-row .value { font-weight: 600; }
.balance-display { font-size: 32px; font-weight: 700; color: var(--primary); text-align: center; padding: 20px 0; }
.balance-display small { font-size: 14px; color: var(--text-light); font-weight: 400; }

/* Responsive */
@media (max-width: 768px) {
    .header-inner { padding: 8px 12px; height: auto; flex-wrap: wrap; }
    .logo-text { font-size: 16px; }
    .logo-img { width: 24px; height: 24px; }
    .slogan { font-size: 20px; }
    .intro { font-size: 13px; }
    /* 手机端一行两个智能体卡片，紧凑展示 */
    .agent-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .agent-card { padding: 14px; }
    .agent-card .agent-icon { font-size: 28px; margin-bottom: 8px; }
    .agent-card .agent-name { font-size: 15px; margin-bottom: 6px; }
    .agent-card .agent-desc { font-size: 11px; -webkit-line-clamp: 3; }
    .agent-card .agent-price { font-size: 10px; margin-top: 8px; }
    .auth-container { margin: 20px; padding: 20px; }

    /* 手机端登录态顶栏：logo独占第一行左端，导航区wrap到第二行右对齐 */
    .header-nav { width: 100%; justify-content: flex-end; flex-wrap: wrap; gap: 4px 6px; margin-top: 6px; }
    .header-nav .biz-coop { padding: 4px 10px; font-size: 12px; }
    .header-nav .user-info { padding: 3px 7px; font-size: 11px; max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .header-nav .user-info.balance { font-size: 11px; max-width: none; overflow: visible; }
    .header-nav a { font-size: 12px; padding: 2px 2px; }
}
