/* ============================================================
   AnonAsk v2 公共样式
   ============================================================ */

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

body {
    font-family: 'Roboto', system-ui, -apple-system, 'Segoe UI',
                 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(145deg, #f9f5ff 0%, #f0f3fe 100%);
    color: #1e1e2f;
    min-height: 100vh;
}

:root {
    --md-primary: #7c4dff;
    --md-primary-container: #e9ddff;
    --md-surface: #ffffff;
    --md-surface-variant: #f5f3fe;
    --md-on-surface: #1c1b1f;
    --md-outline: #79747e;
    --md-elevation-1: 0 1px 2px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.1);
    --md-elevation-2: 0 4px 8px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.05);
}

a { color: var(--md-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ====== 布局 ====== */
.page-wrap { max-width: 800px; margin: 2rem auto; padding: 0 1rem; }
.page-wide { max-width: 1000px; }

/* ====== 顶部导航 ====== */
.navbar {
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(124,77,255,0.15);
    position: sticky; top: 0; z-index: 100;
}
.nav-inner {
    max-width: 1280px; margin: 0 auto; padding: 0.6rem 2rem;
    display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
    font-weight: 700; font-size: 1.4rem;
    background: linear-gradient(125deg, #6a3de8, #b87aff);
    -webkit-background-clip: text;
    background-clip: text; color: transparent;
}
.nav-links { display: flex; gap: 0.8rem; align-items: center; }
.nav-link {
    padding: 0.4rem 1rem; border-radius: 32px; font-weight: 500;
    color: #2c2c3a; transition: 0.2s; font-size: 0.9rem;
}
.nav-link:hover { background: rgba(124,77,255,0.1); color: var(--md-primary); text-decoration: none; }

/* ====== 卡片 ====== */
.card {
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(6px);
    border-radius: 32px; padding: 2rem;
    box-shadow: var(--md-elevation-1);
    border: 1px solid rgba(124,77,255,0.2);
}

/* ====== 表单 ====== */
.form-group { margin-bottom: 1.2rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.4rem; color: var(--md-on-surface); }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 0.75rem 1rem;
    border: 1.5px solid #e0e0e0; border-radius: 16px;
    font-size: 1rem; font-family: inherit; background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus, .form-group textarea:focus {
    outline: none; border-color: var(--md-primary);
    box-shadow: 0 0 0 3px rgba(124,77,255,0.1);
}
.form-group .char-counter { text-align: right; font-size: 0.85rem; color: #888; margin-top: 4px; }

/* ====== 按钮 ====== */
.btn {
    display: inline-block; padding: 0.6rem 1.5rem; border-radius: 40px;
    font-weight: 500; font-size: 0.95rem; border: none; cursor: pointer;
    transition: all 0.2s; box-shadow: var(--md-elevation-1);
}
.btn-primary {
    background: linear-gradient(135deg, #7c4dff 0%, #b47cff 100%);
    color: white;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--md-elevation-2); }
.btn-outline {
    background: white; border: 1px solid var(--md-outline);
    color: var(--md-primary);
}
.btn-outline:hover { background: #f0ebff; border-color: var(--md-primary); }
.btn-danger { background: #e74c3c; color: white; }
.btn-danger:hover { background: #c0392b; }
.btn-sm { padding: 0.3rem 0.8rem; font-size: 0.85rem; }
.btn-full { width: 100%; padding: 0.75rem; font-size: 1.05rem; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ====== 弹窗 ====== */
.modal-overlay {
    position: fixed; top:0; left:0; width:100%; height:100%;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center; z-index: 2000;
}
.modal-box {
    background: white; max-width: 460px; width: 90%;
    border-radius: 32px; padding: 28px 24px;
    box-shadow: 0 24px 48px rgba(0,0,0,0.2); text-align: center;
}

/* ====== Loading ====== */
.loading-overlay {
    position: fixed; top:0; left:0; width:100%; height:100%;
    background: rgba(255,255,255,0.8); z-index: 3000;
    display: flex; align-items: center; justify-content: center;
}
.spinner { width: 36px; height: 36px; border: 4px solid #e0e0e0; border-top-color: var(--md-primary); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ====== 提示 ====== */
.alert { padding: 0.8rem 1rem; border-radius: 12px; margin-bottom: 1rem; font-size: 0.9rem; }
.alert-error { background: #ffeaea; color: #c0392b; border-left: 4px solid #e74c3c; }
.alert-success { background: #e8f8e8; color: #27ae60; border-left: 4px solid #2ecc71; }

/* ====== 问题卡片 ====== */
.q-item {
    background: white; border-radius: 20px; padding: 1.2rem 1.5rem;
    margin-bottom: 0.8rem; box-shadow: var(--md-elevation-1);
    border: 1px solid rgba(124,77,255,0.08);
    transition: 0.2s;
}
.q-item:hover { box-shadow: var(--md-elevation-2); }
.q-item-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.3rem; }
.q-item-meta { font-size: 0.85rem; color: #888; display: flex; gap: 1rem; flex-wrap: wrap; }

/* ====== 回答卡片（不显示任何用户信息） ====== */
.answer-item {
    background: white; border-radius: 20px; padding: 1.2rem 1.5rem;
    margin-bottom: 0.8rem; box-shadow: var(--md-elevation-1);
    border: 1px solid rgba(124,77,255,0.08);
}
.answer-content { line-height: 1.7; white-space: pre-wrap; }
.answer-time { font-size: 0.8rem; color: #aaa; margin-top: 0.5rem; }

/* ====== 响应式 ====== */
@media (max-width: 700px) {
    .page-wrap { margin: 1rem auto; }
    .card { padding: 1.2rem; border-radius: 24px; }
    .nav-inner { padding: 0.5rem 1rem; }
}
