/* SharpGo_刷题狗 - 全站公共样式（浅色主题，与首页 index 一致） */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400&display=swap');
@import url('navbar-icons.css');

:root {
    --bg-color: #ffffff;
    --card-bg: #f3f4f6;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --accent: rgb(116, 123, 255);
    --border-color: #e5e7eb;
    --font-body: "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Nunito", "幼圆", "Yuanti SC", "STYuanti", "Hiragino Sans GB", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
    --nav-bg: rgba(255, 255, 255, 0.9);
    --card-icon-color: #5a5a5a;

    /* 旧页面 / 组件兼容别名（原新丑风变量名） */
    --color-black: var(--text-main);
    --color-white: #ffffff;
    --color-yellow: var(--accent);
    --color-green: #34c759;
    --color-pink: var(--accent);
    --color-blue: var(--accent);
    --border-thick: 1px;
    --shadow-hard: 0 4px 14px rgba(0, 0, 0, 0.08);
    --shadow-hard-hover: 0 8px 22px rgba(0, 0, 0, 0.1);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --transition-bounce: all 0.2s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    transition: all 0.2s ease;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    background-color: var(--bg-color);
    background-image: none;
    color: var(--text-main);
    font-family: var(--font-body);
    font-weight: 400;
    padding-top: 0;
    min-height: 100vh;
    max-height: 100vh;
}

h1, h2, h3, h4, h5, h6, b, strong, button, input, select, textarea {
    font-weight: 400;
}

/* ========== 顶栏（与 index 一致） ========== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 0.8rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--nav-bg);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

/* 文字链 Logo 用背景图统一为 SharpGo 图（路径相对 css 目录） */
.navbar .logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    line-height: 0;
    width: 220px;
    height: 2.6rem;
    max-width: min(320px, 72vw);
    background: url('../gosharp-logo.png') left center / contain no-repeat;
    font-size: 0 !important;
    overflow: hidden;
    color: transparent !important;
    text-shadow: none !important;
    transform: none !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

.navbar .logo-img {
    display: block;
    height: 2.6rem;
    width: auto;
    max-width: min(320px, 72vw);
    object-fit: contain;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-link {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav-link:hover, .nav-link.active { color: var(--text-main); }

/* 顶栏按钮：与 index .btn-auth 一致 */
.btn-auth,
.btn-register, .btn-login, .auth-btn, .logout-btn, .message-btn,
.admin-btn, .ai-analysis-btn, .account-btn, .user-display, .points-btn, .home-btn {
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-main);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 400;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: none;
    transition: all 0.2s ease;
}

.btn-auth:hover,
.btn-register:hover, .btn-login:hover, .auth-btn:hover, .logout-btn:hover,
.message-btn:hover, .admin-btn:hover, .ai-analysis-btn:hover,
.account-btn:hover, .user-display:hover, .points-btn:hover, .home-btn:hover {
    transform: none;
    border-color: var(--accent);
    color: var(--accent);
    background: transparent;
    box-shadow: none;
}

.message-btn { position: relative; }

.msg-badge,
.msg-unread-badge {
    display: none;
    background: #ef4444;
    color: white;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 10px;
    margin-left: 3px;
    font-weight: 400;
    border: none;
    min-width: auto;
    height: auto;
    animation: none;
}

/* ========== 主内容区：单页内滚动（不滚动整页 document） ========== */
.container-page,
.container,
.main-content {
    margin-top: 3.6rem;
    height: calc(100vh - 3.6rem);
    max-height: calc(100vh - 3.6rem);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    width: 100%;
}

main.main-stage {
    margin-top: 0;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

/* ========== 首页 index 专用 ========== */
.main-stage {
    height: 100vh;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 5rem 20px 20px;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
}

/* 首页：主内容（Logo + 三卡）整体上移约 10% 视口高度 */
.main-stage .hero,
.main-stage .feature-grid {
    transform: translateY(-10vh);
}

.hero {
    text-align: center;
    margin-bottom: 3rem;
    flex-shrink: 0;
}

.hero-logo-heading {
    margin: 0 0 0.5rem;
    line-height: 0;
    font-size: 0;
}

.hero-logo-img {
    display: block;
    margin: 0 auto;
    height: 7.5rem;
    width: auto;
    max-width: min(580px, 92vw);
    object-fit: contain;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    width: 100%;
    max-width: 1100px;
    flex-shrink: 1;
    min-height: 0;
}

.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

.feature-card:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
}

.card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--card-icon-color);
}

.card-icon-svg {
    width: 2.5rem;
    height: 2.5rem;
    flex-shrink: 0;
    display: block;
}

.card-title {
    font-size: 2.5rem;
    margin-bottom: 1.25rem;
    color: var(--accent);
}

.sub-menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem 1rem;
}

.sub-item {
    font-size: 1rem;
    padding: 0;
    background: none;
    border: none;
    border-radius: 0;
    color: var(--text-main);
    text-decoration: none;
}

a.sub-item { cursor: pointer; }

.sub-item:hover {
    color: var(--accent);
    background: none;
}

.footer {
    position: absolute;
    bottom: 2rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.6;
}

.footer a {
    color: inherit;
    text-decoration: none;
}

.footer a:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* ========== 旧 common 组件（弱化粗边框，保留结构） ========== */
.container-page {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    padding: 24px 20px 40px;
}

.section-light {
    background: var(--color-white);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-bounce);
}

.section-light:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hard);
}

.section-title-light {
    font-size: 22px;
    font-weight: 400;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--border-color);
    color: var(--text-main);
    position: relative;
    display: inline-block;
    width: 100%;
}

.section-title-light::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 60px;
    height: 2px;
    background: var(--accent);
}

.footer-common {
    text-align: center;
    padding: 24px 5%;
    color: var(--text-muted);
    font-weight: 400;
    font-size: 14px;
    background: var(--bg-color);
    border-top: 1px solid var(--border-color);
}

.back-link {
    color: var(--text-main);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    border-radius: 8px;
    box-shadow: none;
    transition: var(--transition-bounce);
}

.back-link:hover {
    transform: none;
    border-color: var(--accent);
    color: var(--accent);
    background: var(--card-bg);
    box-shadow: none;
}

.nav-page-title {
    font-size: 20px;
    font-weight: 400;
    color: var(--text-main);
    flex: 1;
    text-align: center;
    text-shadow: none;
    letter-spacing: 0;
}

.product-grid { display: grid; gap: 14px; }

.product-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background: var(--color-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-bounce);
    box-shadow: var(--shadow-sm);
}

.product-card:hover, .product-card.selected {
    border-color: var(--accent);
    box-shadow: var(--shadow-hard);
    transform: translateY(-2px);
}

.product-card .name { font-size: 17px; font-weight: 400; }
.product-card .desc { font-size: 12px; color: #6b7280; margin-top: 4px; }
.product-card .price { font-size: 22px; font-weight: 400; color: var(--text-main); }

.btn-pay, .btn-primary-full {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-bounce);
}

.btn-pay:hover, .btn-primary-full:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-hard);
}

.profile-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px dashed #e5e7eb;
    font-size: 14px;
}

.profile-row:last-child { border-bottom: none; }
.profile-row .label { color: #6b7280; }
.profile-row .value { font-weight: 400; }

.search-bar { display: flex; gap: 10px; margin-bottom: 20px; }

.search-bar input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.search-bar input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(116, 123, 255, 0.2);
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@media (max-width: 768px) {
    .navbar { padding: 0.6rem 1rem; }
    .nav-right { gap: 8px; }
    .nav-right .auth-btn, .nav-right .message-btn, .nav-right .account-btn {
        padding: 5px 10px;
        font-size: 0.75rem;
    }
    .feature-grid { grid-template-columns: 1fr; }
    .hero-logo-img {
        height: 6rem;
        max-width: min(480px, 92vw);
    }
    .main-stage {
        padding-top: 5rem;
        justify-content: flex-start;
        overflow: hidden;
    }
    .main-stage .hero,
    .main-stage .feature-grid {
        transform: translateY(-5vh);
    }
}
