/* ======================================
   衣衡制造 - 门户网站样式
   ====================================== */

/* Reset & Base */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #1a1a2e;
    --primary-light: #16213e;
    --accent: #e94560;
    --accent-hover: #c73851;
    --text: #333;
    --text-light: #666;
    --text-muted: #999;
    --bg: #f8f9fa;
    --bg-white: #fff;
    --border: #e0e0e0;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --radius: 8px;
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ========== Navbar ========== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-placeholder {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: rgba(255,255,255,0.5);
    letter-spacing: 1px;
}

.logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.logo-img-lg {
    height: 80px;
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    padding-right: 45px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--text-muted);
    padding: 4px 8px;
    line-height: 1;
}

.password-toggle:hover {
    color: var(--text);
}

.brand-name {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}

.nav-links a:hover { color: #fff; }

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.trial-badge {
    background: rgba(233, 69, 96, 0.2);
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    border: 1px solid rgba(233, 69, 96, 0.3);
}

.user-badge {
    color: #fff;
    font-size: 14px;
    padding: 4px 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
}

/* ========== Buttons ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }

.btn-outline {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.4);
}
.btn-outline:hover { background: rgba(255,255,255,0.1); border-color: #fff; }

.btn-outline-light {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255,255,255,0.6);
}
.btn-outline-light:hover { background: rgba(255,255,255,0.15); }

.btn-lg { padding: 14px 36px; font-size: 16px; border-radius: 50px; }
.btn-block { width: 100%; }

/* ========== Hero ========== */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    overflow: hidden;
    /* 防止文字被裁剪：确保内容层不受 overflow 影响 */
}

.hero > *:not(.hero-overlay) {
    position: relative;
    z-index: 1;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(233, 69, 96, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(22, 33, 62, 0.3) 0%, transparent 50%);
    animation: heroFloat 20s ease-in-out infinite;
}

@keyframes heroFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(1deg); }
    66% { transform: translate(-20px, 20px) rotate(-1deg); }
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.03)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: #fff;
}

.hero-content h1 {
    font-size: 64px;
    font-weight: 800;
    letter-spacing: 8px;
    margin-bottom: 16px;
    color: #fff;
    text-shadow: 0 2px 12px rgba(233, 69, 96, 0.3);
    max-width: 100%;
    word-break: keep-all;
    overflow-wrap: normal;
}

.hero-subtitle {
    font-size: 24px;
    font-weight: 300;
    color: rgba(255,255,255,0.9);
    margin-bottom: 12px;
    letter-spacing: 4px;
}

.hero-desc {
    font-size: 16px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 40px;
    letter-spacing: 6px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
}

/* ========== Features ========== */
.features {
    padding: 100px 0;
    background: var(--bg-white);
    scroll-margin-top: 72px;
}

.section-title {
    text-align: center;
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

.section-desc {
    text-align: center;
    color: var(--text-light);
    font-size: 16px;
    margin-bottom: 60px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.feature-card {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 40px 30px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid transparent;
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent);
}

.feature-icon {
    width: 64px;
    height: 64px;
    line-height: 64px;
    font-size: 36px;
    margin: 0 auto 20px;
    background: rgba(233, 69, 96, 0.08);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-card h3 {
    font-size: 20px;
    color: var(--primary);
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.8;
}

/* ========== Comments Section ========== */
.comments-section {
    padding: 100px 0;
    background: var(--bg);
    scroll-margin-top: 72px;
}

.comment-form-wrapper {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 40px;
    box-shadow: var(--shadow);
}

.comment-form-wrapper h3 {
    font-size: 18px;
    color: var(--primary);
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    min-width: 0;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    transition: var(--transition);
    outline: none;
    font-family: inherit;
}

/* Placeholder 可见性修复 */
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #aaa;
    opacity: 1;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.1);
}

/* 弹窗表单内 input placeholder */
.modal-body .form-group input::placeholder,
.modal-body .form-group textarea::placeholder {
    color: #aaa;
    opacity: 1;
}

.required { color: var(--accent); }
.optional { color: var(--text-muted); font-weight: 400; font-size: 12px; }

.char-count {
    display: block;
    text-align: right;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.field-hint {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Comments List */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comment-item {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 20px 24px;
    box-shadow: var(--shadow);
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.comment-nickname {
    font-weight: 600;
    color: var(--primary);
    font-size: 14px;
}

.comment-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(233, 69, 96, 0.1);
    color: var(--accent);
}

.comment-time {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto;
}

.comment-content {
    font-size: 14px;
    color: var(--text);
    line-height: 1.8;
}

/* ========== Footer ========== */
.footer {
    background: var(--primary);
    color: rgba(255,255,255,0.6);
    text-align: center;
    padding: 24px 0;
    font-size: 14px;
}

/* ========== Modal ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal {
    background: var(--bg-white);
    border-radius: 12px;
    width: 420px;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 18px;
    color: var(--primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover { color: var(--text); }

.modal-body {
    padding: 24px;
}

.checkbox-group { margin-top: 8px; }

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-light);
}

.checkbox-label input[type="checkbox"] {
    margin-top: 3px;
    accent-color: var(--accent);
}

.checkbox-label a {
    color: var(--accent);
    text-decoration: none;
}

.checkbox-label a:hover { text-decoration: underline; }

.form-footer {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-light);
}

.form-footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.form-footer a:hover { text-decoration: underline; }

.force-message {
    text-align: center;
    color: var(--text);
    font-size: 15px;
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(233, 69, 96, 0.05);
    border-radius: var(--radius);
    border-left: 4px solid var(--accent);
}

/* ========== Trial Notice ========== */
.trial-notice {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: rgba(26, 26, 46, 0.95);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 13px;
    box-shadow: var(--shadow-lg);
    z-index: 900;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ========== Toast ========== */
.toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    color: #fff;
    animation: toastIn 0.3s ease;
    max-width: 320px;
}

.toast-success { background: #27ae60; }
.toast-error { background: var(--accent); }
.toast-info { background: #3498db; }

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ========== Auth Page ========== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.auth-card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 40px 32px;
    box-shadow: var(--shadow-lg);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header .logo-placeholder {
    margin: 0 auto 16px;
    border-color: var(--primary);
}

.auth-header h2 {
    font-size: 24px;
    color: var(--primary);
    margin-bottom: 4px;
}

.auth-header p {
    color: var(--text-light);
    font-size: 14px;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .hero-content h1 { font-size: 36px; letter-spacing: 4px; }
    .hero-subtitle { font-size: 18px; }
    .hero-desc { font-size: 14px; letter-spacing: 3px; }
    .hero-actions { flex-direction: column; align-items: center; }
    .nav-links { gap: 12px; }
    .nav-links > a { display: none; }
    .form-row { grid-template-columns: 1fr; }
    .feature-grid { grid-template-columns: 1fr; }
    .section-title { font-size: 28px; }
}
