/* 有趣猫 - 担保交易平台 全局样式 */
/* Redesigned to match design image exactly */

:root {
    --primary: #2aba60;
    --primary-dark: #229954;
    --primary-light: #e8f8ef;
    --orange: #feb35c;
    --orange-dark: #f0a030;
    --orange-light: #fef5e7;
    --black: #1a1a1a;
    --dark-bg: #2d2d2d;
    --text: #666666;
    --text-dark: #1a1a1a;
    --text-medium: #666666;
    --text-light: #999999;
    --bg: #f5f5f5;
    --white: #ffffff;
    --card-bg: #ffffff;
    --border: #eeeeee;
    --shadow: 0 2px 16px rgba(0,0,0,0.06);
    --shadow-sm: 0 1px 6px rgba(0,0,0,0.04);
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 50px;
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.6;
    padding-bottom: 70px;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s;
}

a:active {
    opacity: 0.7;
}

img {
    max-width: 100%;
    display: block;
}

/* ========== 1. Black Header Bar ========== */
.site-header {
    background: var(--black);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 50px;
    padding: 0 16px;
    max-width: 750px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
}

.logo-icon {
    width: 30px;
    height: 30px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 17px;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-login {
    color: rgba(255,255,255,0.85);
    font-size: 16px;
    font-weight: 400;
    white-space: nowrap;
}

.header-user {
    display: flex;
    align-items: center;
}

.header-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(255,255,255,0.3);
}

.header-right .fa-user-circle {
    font-size: 26px;
    color: rgba(255,255,255,0.7);
}

.hamburger-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.85);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========== 2. Scrolling Marquee/Ticker ========== */
.marquee-bar {
    background: #f0f0f0;
    overflow: hidden;
    padding: 10px 0;
    border-bottom: 1px solid #e8e8e8;
}

.marquee-inner {
    overflow: hidden;
    max-width: 750px;
    margin: 0 auto;
}

.marquee-track {
    display: flex;
    gap: 40px;
    animation: marqueeScroll 20s linear infinite;
    white-space: nowrap;
    width: max-content;
}

@keyframes marqueeScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.marquee-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.marquee-avatar {
    color: var(--primary);
    font-size: 16px;
}

.marquee-text {
    font-size: 15px;
    color: var(--text-medium);
    white-space: nowrap;
}

/* ========== 3. Hero Section ========== */
.hero-section {
    background: var(--white);
    padding: 40px 20px 36px;
    text-align: center;
}

.hero-inner {
    max-width: 750px;
    margin: 0 auto;
}

.hero-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.4;
    margin-bottom: 14px;
    letter-spacing: -0.3px;
}

.hero-subtitle {
    font-size: 16px;
    color: var(--text-light);
    line-height: 1.7;
    max-width: 400px;
    margin: 0 auto;
}

/* ========== 4. Hot Products Section ========== */
.hot-products-section {
    padding: 30px 0 20px;
    background: var(--white);
    margin-top: 1px;
}

.section-header {
    text-align: center;
    padding: 0 20px 20px;
}

.section-title-main {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.section-subtitle {
    font-size: 15px;
    color: var(--text-light);
}

.hot-products-scroll {
    display: flex;
    gap: 12px;
    padding: 0 16px 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}

.hot-products-scroll::-webkit-scrollbar {
    display: none;
}

.hot-product-card {
    flex: 0 0 140px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 14px;
    text-align: center;
    scroll-snap-align: start;
    transition: transform 0.2s;
}

.hot-product-card:active {
    transform: scale(0.97);
}

.hot-product-icon {
    width: 44px;
    height: 44px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    color: var(--primary);
    font-size: 18px;
}

.hot-product-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.hot-product-price {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.hot-product-change {
    font-size: 14px;
    font-weight: 600;
}

.hot-product-change.positive {
    color: var(--primary);
}

.hot-product-change.negative {
    color: #e74c3c;
}

/* ========== 5. TAB Section ========== */
.tab-section {
    background: var(--white);
    margin-top: 10px;
    padding: 0 0 20px;
}

.tab-header {
    display: flex;
    background: #f5f5f5;
    border-radius: 12px 12px 0 0;
    padding: 4px;
    margin: 0 16px;
}

.tab-btn {
    flex: 1;
    padding: 14px 0;
    text-align: center;
    font-size: 18px;
    font-weight: 500;
    color: #666;
    background: transparent;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active {
    background: #fff;
    color: #333;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.tab-content {
    display: none;
    padding: 0;
}

.tab-content.active {
    display: block;
}

/* Toggle Switches */
.toggle-group {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.toggle-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.toggle-switch {
    width: 40px;
    height: 22px;
    background: #ddd;
    border-radius: 11px;
    position: relative;
    transition: background 0.3s;
    flex-shrink: 0;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle-option.active .toggle-switch {
    background: var(--primary);
}

.toggle-option.active .toggle-switch::after {
    transform: translateX(18px);
}

.toggle-label {
    font-size: 16px;
    color: var(--text-dark);
    font-weight: 500;
}

.toggle-note {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 18px;
    padding: 8px 12px;
    background: #fafafa;
    border-radius: 6px;
    border-left: 3px solid var(--orange);
}

/* Sell Form */
.sell-form {
    margin-bottom: 28px;
    margin-top: 15px;
}

.form-row {
    margin-bottom: 12px;
}

.form-select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    color: var(--text-dark);
    background: var(--white);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.form-select:focus {
    border-color: var(--primary);
}

.input-with-unit {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-top: 10px;
}

.input-with-unit input {
    flex: 1;
    padding: 12px 14px;
    border: none;
    outline: none;
    font-size: 16px;
    color: var(--text-dark);
    background: transparent;
}

.input-unit {
    padding: 0 14px;
    font-size: 16px;
    color: var(--text-light);
    background: #fafafa;
    border-left: 1px solid var(--border);
    line-height: 44px;
    white-space: nowrap;
}

.form-input-full {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    color: var(--text-dark);
    outline: none;
    background: var(--white);
}

.form-input-full:focus {
    border-color: var(--primary);
}

.btn-sell-cta {
    display: block;
    width: 100%;
    padding: 16px;
    background: var(--primary);
    color: #fff;
    text-align: center;
    font-size: 19px;
    font-weight: 700;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
    letter-spacing: 1px;
}

.btn-sell-cta:active {
    background: var(--primary-dark);
}

/* Buy Panel */
.buy-panel {
    padding: 0;
}

.buy-filter-row {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.buy-filter-row .form-select {
    flex: 1;
}

.filter-btn {
    padding: 10px 16px;
    background: #f5f5f5;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    color: var(--text-dark);
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-btn:active {
    background: #eee;
}

/* Seller List */
.seller-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.seller-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    transition: transform 0.15s;
}

.seller-card:active {
    transform: scale(0.98);
}

.seller-info {
    flex: 1;
    min-width: 0;
}

.seller-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.seller-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-dark);
}

.seller-badge {
    color: var(--primary);
    font-size: 16px;
}

.seller-stars {
    color: var(--orange);
    font-size: 13px;
    display: flex;
    gap: 1px;
}

.seller-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 14px;
    color: var(--text-light);
}

.seller-details span {
    background: #f5f5f5;
    padding: 2px 8px;
    border-radius: 4px;
}

.seller-price-area {
    text-align: right;
    flex-shrink: 0;
    margin-left: 12px;
}

.seller-price-label {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 2px;
}

.seller-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.btn-chat {
    padding: 7px 16px;
    background: var(--orange);
    color: #fff;
    border: none;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.btn-chat:active {
    background: var(--orange-dark);
}

/* ========== 6. Tutorial Section ========== */
.tutorial-section {
    background: var(--white);
    padding: 36px 20px;
    margin-top: 10px;
}

.tutorial-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 28px;
}

.tutorial-steps {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 500px;
    margin: 0 auto;
}

.tutorial-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.step-icon {
    width: 56px;
    height: 56px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    color: var(--primary);
    font-size: 22px;
}

.step-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.step-desc {
    font-size: 15px;
    color: var(--text-light);
    line-height: 1.6;
    max-width: 280px;
}

/* ========== 7. Dark Footer ========== */
.site-footer {
    background: var(--dark-bg);
    padding: 28px 20px 20px;
    text-align: center;
    margin-top: 10px;
}

.footer-links {
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    font-size: 15px;
    transition: color 0.2s;
}

.footer-links a:active {
    color: #fff;
}

.footer-sep {
    color: rgba(255,255,255,0.3);
    margin: 0 10px;
    font-size: 15px;
}

.footer-copy {
    font-size: 14px;
    color: rgba(255,255,255,0.4);
}

/* ========== Bottom Navigation ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    display: flex;
    justify-content: space-around;
    padding: 6px 0 env(safe-area-inset-bottom, 6px);
    box-shadow: 0 -1px 12px rgba(0,0,0,0.06);
    z-index: 100;
    border-top: 1px solid rgba(0,0,0,0.04);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-light);
    font-size: 12px;
    padding: 4px 16px;
    transition: color 0.2s;
    position: relative;
}

.nav-item i {
    font-size: 20px;
    margin-bottom: 2px;
}

.nav-item span {
    font-weight: 500;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

/* ========== Mobile Menu ========== */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.mobile-menu-overlay.open {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 280px;
    height: 100%;
    background: var(--white);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.mobile-menu-overlay.open .mobile-menu-panel {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: #000000;
    color: #fff;
    font-size: 17px;
    font-weight: 600;
}

.mobile-menu-header .logo-icon {
    width: 28px;
    height: 28px;
    font-size: 16px;
}

.mobile-menu-close {
    margin-left: auto;
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
}

.mobile-menu-nav {
    display: flex;
    flex-direction: column;
    padding: 10px 0;
}

.mobile-menu-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    font-size: 17px;
    color: var(--text-dark);
    transition: background 0.2s;
}

.mobile-menu-nav a:active {
    background: #f5f5f5;
}

.mobile-menu-nav a i {
    width: 20px;
    text-align: center;
    color: var(--text-light);
    font-size: 18px;
}

/* ========== Empty State ========== */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-light);
}

.empty-state i {
    font-size: 44px;
    margin-bottom: 12px;
    opacity: 0.3;
}

.empty-state p {
    font-size: 16px;
}

/* ========== Shared Styles ========== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 16px;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:active {
    background: var(--primary-dark);
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-lg {
    padding: 14px 24px;
    font-size: 18px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
    color: var(--text);
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
    background: var(--white);
}

.form-input:focus {
    border-color: var(--primary);
}

.form-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    outline: none;
    resize: vertical;
    min-height: 100px;
    background: var(--white);
}

.form-textarea:focus {
    border-color: var(--primary);
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: var(--shadow-sm);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
}

.status-badge.success {
    background: var(--primary-light);
    color: var(--primary);
}

.status-badge.warning {
    background: var(--orange-light);
    color: var(--orange);
}

.status-badge.danger {
    background: #fef0f0;
    color: #e74c3c;
}

.status-badge.info {
    background: var(--primary-light);
    color: var(--primary);
}

.status-badge.secondary {
    background: #f4f4f5;
    color: var(--text-light);
}

/* ========== Responsive ========== */
@media (max-width: 375px) {
    .hero-title {
        font-size: 24px;
    }

    .hero-section {
        padding: 30px 16px 28px;
    }

    .hot-product-card {
        flex: 0 0 120px;
        padding: 14px 10px;
    }

    .hot-product-icon {
        width: 38px;
        height: 38px;
        font-size: 16px;
    }

    .seller-card {
        padding: 12px;
    }

    .seller-price {
        font-size: 16px;
    }

    .tutorial-section {
        padding: 28px 16px;
    }

    .step-icon {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
}

@media (min-width: 500px) {
    .hero-title {
        font-size: 32px;
    }

    .tutorial-steps {
        flex-direction: row;
        gap: 20px;
    }

    .tutorial-step {
        flex: 1;
    }

    .hot-products-scroll {
        padding: 0 20px 10px;
    }
}
