/* ===== AI自助建站系统 - 蓝色科技风格 ===== */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;
    --primary-bg: #eff6ff;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif; color: var(--gray-800); background: var(--gray-50); line-height: 1.6; }
a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header { background: #fff; border-bottom: 1px solid var(--gray-200); position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; color: var(--primary); }
.logo svg { width: 32px; height: 32px; }
.nav-links { display: flex; gap: 28px; }
.nav-links a { color: var(--gray-600); font-size: 15px; font-weight: 500; padding: 4px 0; border-bottom: 2px solid transparent; transition: all .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); border-bottom-color: var(--primary); }
.header-right { display: flex; align-items: center; gap: 16px; }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 20px; border-radius: var(--radius); font-size: 14px; font-weight: 500; cursor: pointer; border: none; transition: all .2s; line-height: 1.5; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.btn-outline:hover { background: var(--primary-bg); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #059669; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; color: #fff; }
.btn-lg { padding: 12px 32px; font-size: 16px; border-radius: 10px; }
.btn-sm { padding: 5px 14px; font-size: 13px; }
.msg-badge { position: relative; }
.msg-badge .badge { position: absolute; top: -6px; right: -8px; background: var(--danger); color: #fff; font-size: 11px; min-width: 18px; height: 18px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.user-dropdown { position: relative; }
.user-dropdown .dropdown-toggle { cursor: pointer; display: flex; align-items: center; gap: 6px; color: var(--gray-700); font-size: 14px; }
.user-dropdown .dropdown-menu { position: absolute; top: 100%; right: 0; margin-top: 8px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg); border: 1px solid var(--gray-200); min-width: 160px; padding: 6px 0; display: none; }
.user-dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu a { display: block; padding: 8px 16px; color: var(--gray-700); font-size: 14px; }
.dropdown-menu a:hover { background: var(--primary-bg); color: var(--primary); }

/* Hero */
.hero { background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%); color: #fff; padding: 80px 0; text-align: center; position: relative; overflow: hidden; }
.hero::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-4v4h4zm0-8v-4h-4v4h4zm-4 12v-4h-4v4h4zm8-12v-4h-4v4h4zm0 8v-4h-4v4h4zm-12 0v-4h-4v4h4zm16 0v-4h-4v4h4zm0 8v-4h-4v4h4zm-8 0v-4h-4v4h4zm-4 4v-4h-4v4h4zm8 0v-4h-4v4h4zm4 0v-4h-4v4h4z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E"); }
.hero h1 { font-size: 42px; font-weight: 800; margin-bottom: 16px; position: relative; }
.hero p { font-size: 18px; opacity: .9; margin-bottom: 32px; position: relative; }
.hero .btn-hero { background: #fff; color: var(--primary); font-size: 18px; padding: 14px 40px; border-radius: 12px; font-weight: 600; box-shadow: 0 4px 14px rgba(0,0,0,0.15); position: relative; }
.hero .btn-hero:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.2); color: var(--primary-dark); }

/* Category Tabs */
.section { padding: 48px 0; }
.section-title { font-size: 24px; font-weight: 700; margin-bottom: 24px; color: var(--gray-900); }
.cat-tabs { display: flex; gap: 8px; margin-bottom: 28px; flex-wrap: wrap; }
.cat-tab { padding: 8px 20px; border-radius: 20px; background: #fff; border: 1px solid var(--gray-200); color: var(--gray-600); font-size: 14px; cursor: pointer; transition: all .2s; }
.cat-tab:hover, .cat-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Template Cards */
.tpl-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.tpl-card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: all .3s; border: 1px solid var(--gray-200); }
.tpl-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.tpl-card .preview { position: relative; padding-top: 62.5%; overflow: hidden; background: var(--gray-100); }
.tpl-card .preview img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.tpl-card:hover .preview img { transform: scale(1.05); }
.tpl-card .info { padding: 16px; }
.tpl-card .info h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; color: var(--gray-800); }
.tpl-card .info .meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.tpl-card .info .cat { font-size: 12px; color: var(--gray-400); background: var(--gray-100); padding: 2px 8px; border-radius: 4px; }
.tpl-card .info .price { font-size: 16px; font-weight: 700; color: var(--danger); }
.tpl-card .info .price small { font-size: 12px; font-weight: 400; color: var(--gray-400); }
.tpl-card .info .btn { width: 100%; }

/* Auth Pages */
.auth-page { min-height: calc(100vh - 64px); display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--primary-bg) 0%, #fff 100%); padding: 40px 20px; }
.auth-box { background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); padding: 40px; width: 100%; max-width: 420px; }
.auth-box h2 { text-align: center; font-size: 24px; font-weight: 700; color: var(--gray-900); margin-bottom: 8px; }
.auth-box .subtitle { text-align: center; color: var(--gray-500); font-size: 14px; margin-bottom: 28px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; color: var(--gray-700); margin-bottom: 6px; }
.form-control { width: 100%; padding: 10px 14px; border: 1px solid var(--gray-300); border-radius: var(--radius); font-size: 14px; color: var(--gray-800); transition: border-color .2s, box-shadow .2s; outline: none; }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }
.captcha-row { display: flex; gap: 10px; }
.captcha-row .form-control { flex: 1; }
.captcha-row img { height: 42px; border-radius: var(--radius); cursor: pointer; border: 1px solid var(--gray-300); }
.auth-link { text-align: center; margin-top: 16px; font-size: 14px; color: var(--gray-500); }
.auth-link a { font-weight: 500; }
.form-error { color: var(--danger); font-size: 13px; margin-top: 4px; display: none; }

/* Detail Page */
.detail-page { padding: 40px 0; }
.detail-layout { display: grid; grid-template-columns: 1fr 380px; gap: 32px; }
.detail-preview { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--gray-200); }
.detail-preview img { width: 100%; }
.detail-preview .demo-link { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 12px; background: var(--primary-bg); color: var(--primary); font-size: 14px; font-weight: 500; }
.detail-info { background: #fff; border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); border: 1px solid var(--gray-200); }
.detail-info h1 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.detail-info .desc { color: var(--gray-500); font-size: 14px; margin-bottom: 24px; line-height: 1.7; }
.price-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.price-card { border: 2px solid var(--gray-200); border-radius: var(--radius); padding: 14px; text-align: center; cursor: pointer; transition: all .2s; }
.price-card:hover { border-color: var(--primary-light); }
.price-card.selected { border-color: var(--primary); background: var(--primary-bg); }
.price-card .period-name { font-size: 14px; font-weight: 600; color: var(--gray-700); margin-bottom: 4px; }
.price-card .period-price { font-size: 22px; font-weight: 700; color: var(--danger); }
.price-card .period-price small { font-size: 13px; font-weight: 400; color: var(--gray-400); }
.price-card.selected .period-name { color: var(--primary); }
.detail-info .btn { width: 100%; margin-top: 12px; }

/* User Center */
.user-page { padding: 32px 0; min-height: calc(100vh - 64px); }
.user-layout { display: grid; grid-template-columns: 220px 1fr; gap: 24px; }
.user-sidebar { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--gray-200); overflow: hidden; }
.user-sidebar .sidebar-header { padding: 20px; background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: #fff; }
.user-sidebar .sidebar-header h3 { font-size: 16px; font-weight: 600; }
.user-sidebar .sidebar-header p { font-size: 13px; opacity: .8; }
.sidebar-nav a { display: flex; align-items: center; gap: 10px; padding: 14px 20px; color: var(--gray-600); font-size: 14px; border-left: 3px solid transparent; transition: all .2s; }
.sidebar-nav a:hover { background: var(--primary-bg); color: var(--primary); }
.sidebar-nav a.active { background: var(--primary-bg); color: var(--primary); border-left-color: var(--primary); font-weight: 500; }
.user-content { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--gray-200); padding: 24px; min-height: 400px; }
.user-content h2 { font-size: 20px; font-weight: 700; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--gray-200); }

/* Site Cards */
.site-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.site-card { border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 18px; transition: all .2s; }
.site-card:hover { border-color: var(--primary-light); box-shadow: var(--shadow-md); }
.site-card .site-name { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.site-card .site-url { font-size: 13px; color: var(--primary); margin-bottom: 10px; word-break: break-all; }
.site-card .site-meta { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.status-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 500; }
.status-badge.running { background: #d1fae5; color: #065f46; }
.status-badge.expired { background: #fee2e2; color: #991b1b; }
.status-badge.pending { background: #fef3c7; color: #92400e; }
.countdown { font-size: 12px; color: var(--gray-500); }

/* Order Table */
.order-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.order-table th { background: var(--gray-100); padding: 10px 14px; text-align: left; font-weight: 600; color: var(--gray-700); border-bottom: 2px solid var(--gray-200); }
.order-table td { padding: 12px 14px; border-bottom: 1px solid var(--gray-200); color: var(--gray-600); }
.order-table tr:hover td { background: var(--gray-50); }
.pay-status { padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 500; }
.pay-status.paid { background: #d1fae5; color: #065f46; }
.pay-status.unpaid { background: #fee2e2; color: #991b1b; }

/* Message List */
.msg-list .msg-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--gray-100); align-items: flex-start; }
.msg-item .msg-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.msg-item .msg-dot.unread { background: var(--primary); }
.msg-item .msg-dot.read { background: var(--gray-300); }
.msg-item .msg-body { flex: 1; }
.msg-item .msg-body .msg-title { font-size: 14px; font-weight: 500; color: var(--gray-800); margin-bottom: 2px; }
.msg-item .msg-body .msg-content { font-size: 13px; color: var(--gray-500); line-height: 1.5; }
.msg-item .msg-body .msg-time { font-size: 12px; color: var(--gray-400); margin-top: 4px; }

/* Pay Result */
.pay-result { min-height: calc(100vh - 64px); display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.pay-result-box { background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg); padding: 48px; width: 100%; max-width: 560px; text-align: center; }
.pay-result-box .result-icon { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 20px; display: flex; align-items: center; justify-content: center; font-size: 36px; }
.pay-result-box .result-icon.success { background: #d1fae5; color: var(--success); }
.pay-result-box .result-icon.waiting { background: #fef3c7; color: var(--warning); }
.pay-result-box h2 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.pay-result-box .result-desc { color: var(--gray-500); font-size: 14px; margin-bottom: 24px; }
.result-info { text-align: left; background: var(--gray-50); border-radius: var(--radius); padding: 18px; margin-bottom: 24px; }
.result-info .info-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.result-info .info-row .label { color: var(--gray-500); }
.result-info .info-row .value { color: var(--gray-800); font-weight: 500; }
.result-actions { display: flex; gap: 12px; justify-content: center; }

/* Footer */
.site-footer { background: var(--gray-800); color: var(--gray-400); padding: 32px 0; margin-top: 48px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--gray-400); font-size: 13px; }
.footer-links a:hover { color: #fff; }
.footer-copy { font-size: 13px; }

/* Utility */
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.hidden { display: none; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--gray-400); }
.empty-state svg { width: 64px; height: 64px; margin-bottom: 16px; opacity: .5; }
.empty-state p { font-size: 15px; }

/* Responsive */
@media (max-width: 1024px) {
    .tpl-grid { grid-template-columns: repeat(3, 1fr); }
    .detail-layout { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .tpl-grid { grid-template-columns: repeat(2, 1fr); }
    .site-grid { grid-template-columns: 1fr; }
    .user-layout { grid-template-columns: 1fr; }
    .hero h1 { font-size: 28px; }
    .hero p { font-size: 15px; }
    .nav-links { display: none; }
    .price-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .tpl-grid { grid-template-columns: 1fr; }
    .price-cards { grid-template-columns: 1fr; }
}
