:root {
    --primary: #1552d6;
    --primary-light: #eaf1ff;
    --accent: #5b5cf0;
    --ink: #17233c;
    --muted: #6b768d;
    --line: #e7ecf5;
    --bg: #f4f7fc;
    --white: #fff;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    color: var(--ink);
    background: #dfe6f2;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.phone-shell {
    max-width: 480px;
    min-height: 100vh;
    margin: 0 auto;
    background: var(--bg);
    position: relative;
    padding-bottom: 72px;
    box-shadow: 0 0 40px rgba(31, 52, 91, .08);
}

.top-bar {
    height: 56px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 20;
}
.top-bar h1 { margin: 0; font-size: 17px; font-weight: 650; }
.back-btn {
    width: 34px; height: 34px; border: 0; border-radius: 50%;
    background: var(--primary-light); color: var(--primary);
    font-size: 26px; line-height: 1; cursor: pointer;
}
.back-placeholder, .top-bar-right { width: 34px; }

.flash-stack { padding: 12px 16px 0; }
.flash {
    padding: 10px 14px; border-radius: 12px; font-size: 14px;
    background: #eef3ff; color: var(--primary); margin-bottom: 8px;
}
.flash-error { background: #fff0f0; color: #c62828; }
.flash-success { background: #eaf8f1; color: #15803d; }

.page-main { padding: 16px; min-height: calc(100vh - 128px); }

.card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 14px;
    box-shadow: 0 8px 24px rgba(32, 74, 158, .04);
}

.hero-card {
    background: linear-gradient(135deg, #1552d6, #5b5cf0);
    color: #fff;
    border: 0;
    padding: 26px 22px;
}
.hero-card .eyebrow { font-size: 13px; opacity: .82; }
.hero-card h2 { margin: 10px 0 6px; font-size: 26px; }
.hero-card p { margin: 0; opacity: .9; font-size: 14px; }
.friend-count { font-size: 38px; font-weight: 750; line-height: 1.2; margin: 14px 0 2px; }

.section-title { margin: 24px 2px 12px; font-size: 16px; font-weight: 650; }
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 100%; padding: 13px 18px; border-radius: 12px;
    border: 0; font-size: 15px; font-weight: 600; cursor: pointer;
}
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-light)); background: var(--primary); }
.btn-accent { color: #fff; background: linear-gradient(135deg, var(--primary), var(--accent)); }
.btn-ghost { color: var(--primary); background: var(--primary-light); }
.btn-danger { color: #c62828; background: #fff0f0; }
.btn + .btn { margin-top: 10px; }

.tab-bar {
    position: fixed;
    bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: 480px; height: 64px;
    display: flex; background: rgba(255,255,255,.96);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(12px);
    z-index: 30;
}
.tab-bar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; color: var(--muted); font-size: 12px;
}
.tab-bar a.active { color: var(--primary); font-weight: 600; }
.tab-icon { font-size: 22px; line-height: 1; }

.login-hero { text-align: center; padding: 32px 16px 20px; }
.login-logo {
    width: 68px; height: 68px; margin: 0 auto 16px; border-radius: 20px;
    display: grid; place-items: center; color: #fff; font-size: 30px; font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
}
.login-hero h2 { margin: 0 0 8px; font-size: 24px; }
.login-hero p { margin: 0; color: var(--muted); font-size: 14px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 7px; font-size: 14px; font-weight: 600; }
.form-control {
    width: 100%; padding: 12px 14px; border: 1px solid var(--line);
    border-radius: 12px; background: #fff; font-size: 15px; color: var(--ink);
    outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(21,82,214,.1); }
textarea.form-control { min-height: 88px; resize: vertical; }
.form-row { display: flex; gap: 10px; }
.form-row > .form-group { flex: 1; }
.code-row { display: flex; gap: 10px; }
.code-row .form-control { flex: 1; }
.code-row .btn { width: auto; white-space: nowrap; padding: 0 14px; margin: 0; }
.hint { color: var(--muted); font-size: 13px; }

.profile-card { text-align: center; padding: 28px 18px 22px; }
.avatar {
    width: 82px; height: 82px; border-radius: 50%; object-fit: cover;
    border: 3px solid #fff; box-shadow: 0 6px 18px rgba(31,52,91,.14);
}
.avatar-placeholder {
    width: 82px; height: 82px; margin: 0 auto; border-radius: 50%;
    display: grid; place-items: center; color: #fff; font-size: 30px; font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border: 3px solid #fff; box-shadow: 0 6px 18px rgba(31,52,91,.14);
}
.profile-name { margin: 14px 0 2px; font-size: 22px; font-weight: 700; }
.profile-nickname { color: var(--muted); font-size: 14px; }
.profile-meta { margin-top: 14px; display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.tag { padding: 5px 12px; border-radius: 999px; background: var(--primary-light); color: var(--primary); font-size: 13px; }

.timeline-item { position: relative; padding-left: 22px; padding-bottom: 18px; }
.timeline-item::before {
    content: ''; position: absolute; left: 5px; top: 8px; bottom: -2px;
    width: 2px; background: var(--line);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
    position: absolute; left: 0; top: 6px; width: 12px; height: 12px;
    border-radius: 50%; background: var(--primary); border: 3px solid var(--primary-light);
}
.timeline-title { font-weight: 650; font-size: 15px; }
.timeline-sub { color: var(--muted); font-size: 13px; }
.timeline-desc { margin-top: 6px; font-size: 14px; color: #4c5872; white-space: pre-wrap; }

.float-join {
    position: fixed; bottom: 82px; left: 50%; transform: translateX(-50%);
    width: calc(100% - 32px); max-width: 448px; z-index: 25;
}
.float-join .btn { border-radius: 999px; box-shadow: 0 10px 24px rgba(21,82,214,.28); }

.avatar-edit { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.avatar-edit img, .avatar-edit .avatar-placeholder { width: 64px; height: 64px; font-size: 24px; }
.file-label {
    display: inline-block; padding: 8px 14px; border-radius: 10px;
    background: var(--primary-light); color: var(--primary); font-size: 14px; cursor: pointer;
}
.file-label input { display: none; }
.switch-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; }
.switch-row span { font-size: 14px; }
.switch-row input { width: 20px; height: 20px; accent-color: var(--primary); }

.empty { text-align: center; color: var(--muted); padding: 28px 12px; font-size: 14px; }
