* { margin:0; padding:0; box-sizing:border-box; }
body {
    font-family: -apple-system, 'Open Sans', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #f5f1ec; color: #2c2c2c;
    overflow-x: hidden;
}
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; background: #f5f1ec; position: relative; }
.page { display: none; min-height: 100vh; }
.page.active { display: block; }

.splash {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-height: 100vh; padding: 40px 30px;
    background: linear-gradient(160deg, #e8ddd0 0%, #f5f1ec 40%, #fff 100%);
}
.paw-logo { font-size: 64px; margin-bottom: 4px; }
.logo-text { font-size: 2.6rem; font-weight: 800; color: #c0702b; letter-spacing: 3px; }
.tagline { color: #8b7355; margin: 2px 0 28px; font-size: 0.95rem; }
.login-box { width: 100%; max-width: 320px; display: flex; flex-direction: column; gap: 10px; }

.input-furry {
    padding: 12px 16px; border: 1.5px solid #ddd6ce; border-radius: 8px;
    font-size: 15px; outline: none; background: #fff; color: #2c2c2c;
    transition: all .2s; width: 100%;
}
.input-furry::placeholder { color: #bbb0a5; }
.input-furry:focus { border-color: #c0702b; box-shadow: 0 0 0 3px rgba(192,112,43,0.1); }
.input-sm { padding: 9px 12px; font-size: 13px; border-radius: 6px; }
.input-chat { border-radius: 20px; padding: 10px 16px; flex: 1; font-size: 14px; }
select.input-furry { appearance: auto; background: #fff; }
textarea.input-furry { resize: vertical; min-height: 60px; }

.btn-furry {
    padding: 12px; border: none; border-radius: 8px; font-size: 15px;
    font-weight: 600; cursor: pointer; transition: all .2s;
}
.btn-primary { background: #c0702b; color: #fff; }
.btn-primary:hover { background: #a85f1f; transform: translateY(-1px); }
.btn-outline { background: transparent; border: 1.5px solid #c0702b; color: #c0702b; }
.btn-outline:hover { background: #c0702b; color: #fff; }
.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: 6px; }
.msg { font-size: 14px; text-align: center; min-height: 24px; color: #d9534f; font-weight: 600; padding: 4px 0; }

.top-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: #fff; border-bottom: 1px solid #e8e0d8;
    padding: 8px 0 4px; max-width: 480px; margin: 0 auto;
}
.nav-brand { text-align: center; font-size: 12px; color: #c0702b; letter-spacing: 2px; font-weight: 600; margin-bottom: 2px; }
.nav-tabs { display: flex; justify-content: space-around; }
.nav-tab { padding: 6px 16px; font-size: 14px; cursor: pointer; color: #8b7355; border-radius: 6px; transition: all .2s; font-weight: 500; }
.nav-tab.active { background: #f5f1ec; color: #c0702b; font-weight: 700; }

.tab-content { display: none; padding-top: 64px; }
.tab-content.active { display: block; }
.section-title { padding: 16px 20px 8px; font-size: 15px; font-weight: 700; color: #5c4a3a; }
.swipe-hint { text-align: center; padding: 8px 0 0; font-size: 11px; color: #bbb0a5; letter-spacing: 0.5px; }

#card-container { padding: 8px 20px; min-height: 400px; display: flex; justify-content: center; }
.card-stack { position: relative; width: 100%; max-width: 340px; height: 400px; }
.user-card {
    position: absolute; width: 100%; height: 100%; border-radius: 16px;
    overflow: hidden; box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    background: #fff; transition: transform .3s, opacity .3s;
    cursor: pointer; border: 1px solid #eee8e0;
}
.user-card .card-bg {
    width: 100%; height: 58%;
    background: linear-gradient(135deg, #e8ddd0, #ddd0c0);
    display: flex; align-items: center; justify-content: center;
    font-size: 60px;
}
.user-card .card-info { padding: 12px 16px; }
.user-card .card-name { font-size: 18px; font-weight: 700; color: #2c2c2c; }
.user-card .card-species { font-size: 12px; color: #c0702b; margin: 1px 0; }
.user-card .card-bio { font-size: 12px; color: #8b7a6a; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.user-card .card-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.user-card .card-tags span { padding: 2px 8px; border-radius: 4px; background: #f5f1ec; color: #8b7355; font-size: 10px; }
.card-placeholder { text-align: center; padding: 100px 20px; color: #ccc0b0; font-size: 16px; }
.card-placeholder small { color: #ddd0c0; }

.action-btns { display: flex; justify-content: center; gap: 36px; padding: 4px 20px 20px; }
.action-btn { width: 56px; height: 56px; border-radius: 50%; border: none; font-size: 24px; cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,0.06); transition: all .2s; }
.action-pass { background: #fff; color: #c0702b; border: 1.5px solid #eee8e0; }
.action-like { background: #c0702b; color: #fff; }
.action-btn:active { transform: scale(0.92); }

#following-list { padding: 0 20px 20px; }
.follow-item {
    display: flex; align-items: center; gap: 12px;
    padding: 12px; background: #fff; border-radius: 10px;
    margin-bottom: 8px; border: 1px solid #eee8e0;
    cursor: pointer; transition: all .2s;
}
.follow-item:hover { border-color: #c0702b; }
.follow-avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg,#e8ddd0,#ddd0c0); display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; overflow: hidden; }
.follow-avatar img { width: 100%; height: 100%; object-fit: cover; }
.follow-name { font-weight: 600; font-size: 14px; color: #2c2c2c; }
.follow-species { font-size: 11px; color: #8b7355; }

.profile-card { padding: 20px; }
.avatar-upload { width: 88px; height: 88px; border-radius: 50%; margin: 0 auto 14px; position: relative; cursor: pointer; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,0.1); border: 3px solid #fff; }
.avatar-upload img { width: 100%; height: 100%; object-fit: cover; }
.avatar-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.4); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; opacity: 0; transition: .2s; border-radius: 50%; }
.avatar-upload:hover .avatar-overlay { opacity: 1; }
.profile-fields { display: flex; flex-direction: column; gap: 5px; }
.profile-fields label { font-size: 12px; color: #8b7355; margin-top: 4px; }

.user-profile-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: #fff; border-bottom: 1px solid #e8e0d8;
    padding: 12px 16px; display: flex; align-items: center; gap: 10px;
    max-width: 480px; margin: 0 auto;
}
.back-btn { background: none; border: none; font-size: 15px; color: #c0702b; cursor: pointer; padding: 4px 6px; }
.chat-title { font-size: 15px; font-weight: 600; color: #2c2c2c; }
.user-profile-body { padding: 64px 20px 24px; text-align: center; }
.up-avatar { width: 92px; height: 92px; border-radius: 50%; margin: 0 auto 10px; overflow: hidden; border: 3px solid #fff; box-shadow: 0 2px 12px rgba(0,0,0,0.1); }
.up-avatar img { width: 100%; height: 100%; object-fit: cover; }
.up-name { font-size: 22px; font-weight: 700; color: #2c2c2c; }
.up-species { font-size: 16px; color: #c0702b; margin: 2px 0; }
.up-stats { font-size: 12px; color: #8b7355; margin: 4px 0; }
.up-tags { display: flex; justify-content: center; gap: 5px; flex-wrap: wrap; margin: 8px 0; }
.up-tags span { padding: 3px 10px; border-radius: 4px; background: #f5f1ec; color: #8b7355; font-size: 11px; }
.up-bio { font-size: 13px; color: #6a5c4e; margin: 10px auto; max-width: 300px; line-height: 1.6; }
.up-actions { margin-top: 16px; }

.chat-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: #fff; border-bottom: 1px solid #e8e0d8;
    padding: 12px 16px; display: flex; align-items: center; gap: 10px;
    max-width: 480px; margin: 0 auto;
}
.chat-body { padding: 56px 14px 66px; min-height: 100vh; }
.chat-msg { margin: 5px 0; max-width: 78%; padding: 9px 14px; border-radius: 12px; font-size: 14px; line-height: 1.5; word-break: break-word; }
.chat-msg.mine { margin-left: auto; background: #c0702b; color: #fff; border-bottom-right-radius: 4px; }
.chat-msg.other { margin-right: auto; background: #fff; color: #2c2c2c; border: 1px solid #eee8e0; border-bottom-left-radius: 4px; }
.chat-input-bar {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    background: #fff; border-top: 1px solid #e8e0d8;
    padding: 8px 14px; display: flex; gap: 8px; align-items: center;
    max-width: 480px; margin: 0 auto;
}
.btn-send { padding: 9px 16px; border: none; background: #c0702b; color: #fff; border-radius: 20px; font-size: 13px; cursor: pointer; white-space: nowrap; font-weight: 600; }
.profile-link { display: inline-block; margin-top: 16px; font-size: 13px; color: #8b7355; text-decoration: none; padding: 6px 12px; border: 1px solid #ddd6ce; border-radius: 6px; transition: all .2s; }
.profile-link:hover { border-color: #c0702b; color: #c0702b; }
