/* ============================================
   云智互联 V2 - 主样式
   ============================================ */
:root {
    --bg: #0f0f23;
    --dark: #1a1a2e;
    --darker: #12122a;
    --border: #2a2a4a;
    --text: #e0e0e0;
    --text2: #8b949e;
    --accent: #58a6ff;
    --green: #00d4aa;
    --orange: #f0883e;
    --red: #f85149;
    --purple: #bc8cff;
}

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

body {
    font-family: 'Inter', 'Microsoft YaHei', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

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

/* ===== Topbar ===== */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--dark);
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar-brand {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-brand:hover { text-decoration: none; }

.topbar-menu { display: flex; gap: 5px; align-items: center; }

.topbar-menu a {
    padding: 8px 14px;
    color: var(--text2);
    font-size: 13px;
    border-radius: 6px;
    transition: all 0.2s;
    text-decoration: none;
}

.topbar-menu a:hover,
.topbar-menu a.active {
    color: var(--text);
    background: rgba(88, 166, 255, 0.1);
}

.topbar-menu .admin-link { color: var(--orange); }

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
}

/* ===== Container ===== */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== Cards ===== */
.content-card,
.auth-card {
    background: var(--dark);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 20px;
}

.content-card h2,
.auth-card h2 {
    font-size: 22px;
    margin-bottom: 5px;
    color: var(--text);
}

/* ===== Hero ===== */
.hero {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, var(--dark), var(--darker));
    border: 1px solid var(--border);
    border-radius: 16px;
    margin-bottom: 30px;
}

.hero h1 {
    font-size: 36px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--accent), var(--green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text2);
    margin-bottom: 10px;
}

.hero-description {
    color: var(--text2);
    max-width: 500px;
    margin: 0 auto 25px;
    font-size: 14px;
    line-height: 1.8;
}

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

/* ===== Features ===== */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.feature-card {
    background: var(--dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    transition: transform 0.2s;
}

.feature-card:hover { transform: translateY(-3px); }

.feature-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: rgba(88, 166, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 20px;
    color: var(--accent);
}

.feature-card h3 { font-size: 15px; margin-bottom: 6px; }
.feature-card p { font-size: 13px; color: var(--text2); }

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.2s;
    font-family: inherit;
    line-height: 1.4;
}

.btn:hover { opacity: 0.85; transform: translateY(-1px); text-decoration: none; }

.btn-primary { background: linear-gradient(135deg, var(--accent), #1f6feb); color: #fff; }
.btn-success { background: var(--green); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-warning { background: var(--orange); color: #fff; }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-block { width: 100%; justify-content: center; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ===== Forms ===== */
.form-group { margin-bottom: 18px; }

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

.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--darker);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.15);
}

select.form-control { appearance: none; cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }

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

.form-range { width: 100%; accent-color: var(--accent); }
.range-value { color: var(--accent); font-weight: 600; font-size: 16px; }
.char-count { color: var(--text2); font-weight: normal; }
.form-hint { color: var(--text2); font-size: 13px; margin-bottom: 20px; }

.code-input {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ===== Messages ===== */
.message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.message-success { background: rgba(0, 212, 170, 0.1); border: 1px solid rgba(0, 212, 170, 0.3); color: var(--green); }
.message-error { background: rgba(248, 81, 73, 0.1); border: 1px solid rgba(248, 81, 73, 0.3); color: var(--red); }
.message-info { background: rgba(88, 166, 255, 0.1); border: 1px solid rgba(88, 166, 255, 0.3); color: var(--accent); }

/* ===== Auth ===== */
.auth-card { max-width: 420px; margin: 40px auto; text-align: center; }
.auth-link { margin-top: 15px; font-size: 13px; color: var(--text2); }
.auth-link a { color: var(--accent); }

/* ===== Dashboard ===== */
.dashboard-header {
    background: var(--dark);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.user-info h2 { font-size: 20px; margin-bottom: 4px; }
.user-stats { display: flex; gap: 20px; }

.stat-box { text-align: center; }
.stat-num { font-size: 24px; font-weight: 700; color: var(--accent); }
.stat-text { font-size: 11px; color: var(--text2); }

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

.content-list h3 { font-size: 16px; margin-bottom: 15px; color: var(--text); }

.content-table-wrapper { overflow-x: auto; }

.content-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.content-table th {
    background: var(--darker);
    color: var(--text2);
    font-weight: 600;
    text-align: left;
    padding: 10px 12px;
    border-bottom: 2px solid var(--border);
    font-size: 12px;
    text-transform: uppercase;
}

.content-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}

.content-table tr:hover { background: rgba(88, 166, 255, 0.03); }

/* ===== Badges ===== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-success { background: rgba(0, 212, 170, 0.15); color: var(--green); }
.badge-danger { background: rgba(248, 81, 73, 0.15); color: var(--red); }
.badge-warning { background: rgba(240, 136, 62, 0.15); color: var(--orange); }
.badge-info { background: rgba(88, 166, 255, 0.15); color: var(--accent); }

/* ===== Success Header ===== */
.success-header { text-align: center; margin-bottom: 25px; }
.success-icon { font-size: 48px; color: var(--green); margin-bottom: 10px; }
.success-subtitle { color: var(--text2); font-size: 14px; }

/* ===== Link/Code Box ===== */
.section { margin-bottom: 20px; }
.section label { display: block; font-size: 13px; color: var(--text2); margin-bottom: 8px; font-weight: 600; }

.link-box, .code-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--darker);
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.link-box span, .code-box span {
    flex: 1;
    font-size: 13px;
    word-break: break-all;
    font-family: 'Courier New', monospace;
}

.code-box span { font-size: 18px; letter-spacing: 3px; color: var(--orange); font-weight: 700; }

.copy-btn { flex-shrink: 0; }

/* ===== QR Code ===== */
.qrcode-box {
    display: inline-block;
    background: var(--dark);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--border);
    min-width: 220px;
    min-height: 220px;
}

.qrcode-box canvas,
.qrcode-box img {
    display: block !important;
    margin: 0 auto;
    border-radius: 4px;
}

.qr-inline-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(88, 166, 255, 0.1);
    color: var(--accent);
    border: 1px solid rgba(88, 166, 255, 0.3);
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.qr-inline-btn:hover { background: rgba(88, 166, 255, 0.2); }

/* ===== QR Modal ===== */
.qr-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.qr-modal {
    background: var(--dark);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    max-width: 360px;
    width: 90%;
    position: relative;
}

.qr-modal h3 { margin-bottom: 8px; color: var(--text); font-size: 16px; }
.qr-modal p { color: var(--text2); font-size: 13px; margin-bottom: 15px; }

.qr-modal .qr-modal-close {
    position: absolute;
    top: 12px; right: 16px;
    background: none;
    border: none;
    color: var(--text2);
    font-size: 20px;
    cursor: pointer;
}

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

.qr-modal .qr-container {
    background: var(--darker);
    padding: 20px;
    border-radius: 10px;
    display: inline-block;
    margin-bottom: 15px;
}

.qr-modal .qr-container canvas,
.qr-modal .qr-container img {
    display: block !important;
    margin: 0 auto;
}

/* ===== Params Grid ===== */
.params-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.param-item {
    background: var(--darker);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border);
}

.param-value { font-size: 24px; font-weight: 700; color: var(--accent); }
.param-label { font-size: 11px; color: var(--text2); margin-top: 4px; }

/* ===== Countdown ===== */
.countdown-box {
    text-align: center;
    padding: 25px;
    background: var(--dark);
    border: 2px solid var(--border);
    border-radius: 12px;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.countdown-label { font-size: 12px; color: var(--text2); text-transform: uppercase; letter-spacing: 1px; }
.countdown-value { font-size: 56px; font-weight: 700; color: var(--green); line-height: 1.2; margin: 5px 0; }
.countdown-value.danger { color: var(--red); animation: pulse 1s infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.countdown-progress {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin-top: 10px;
    overflow: hidden;
}

.countdown-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--green), var(--orange), var(--red));
    border-radius: 2px;
    transition: width 1s linear;
}

/* ===== Content Box ===== */
.content-box {
    background: var(--darker);
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.content-box pre {
    white-space: pre-wrap;
    word-break: break-word;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text);
    margin: 0;
}

/* ===== View ===== */
.view-header { margin-bottom: 20px; }
.error-state { text-align: center; padding: 40px 20px; }
.error-icon { font-size: 48px; color: var(--orange); opacity: 0.5; margin-bottom: 15px; }

/* ===== Code Verify ===== */
.code-verify { text-align: center; padding: 20px 0; }
.verify-icon { font-size: 48px; color: var(--accent); margin-bottom: 15px; }
.verify-form { max-width: 300px; margin: 20px auto; }

/* ===== Profile ===== */
.profile-info { margin: 20px 0; }

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.info-row span { color: var(--text2); }
.info-row strong { color: var(--text); }

/* ===== Action Buttons ===== */
.action-buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ===== Info Box ===== */
.info-box {
    background: rgba(88, 166, 255, 0.1);
    border: 1px solid rgba(88, 166, 255, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
}

/* ===== Service Contact ===== */
.service-contact {
    background: var(--dark);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 25px;
    margin-top: 30px;
    text-align: center;
}

.service-contact h3, .service-contact h4 { margin-bottom: 10px; }
.service-info {
    background: var(--darker);
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.8;
}

/* ===== Empty State ===== */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text2); }
.empty-state i { font-size: 48px; opacity: 0.3; display: block; margin-bottom: 10px; }

/* ===== Pagination ===== */
.pagination { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 20px; }
.pagination-info { color: var(--text2); font-size: 13px; }

/* ===== Footer ===== */
.footer { text-align: center; padding: 30px 0; color: var(--text2); font-size: 13px; margin-top: 30px; border-top: 1px solid var(--border); }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .topbar { padding: 0 15px; }
    .menu-toggle { display: block; }
    .topbar-menu {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--dark);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 10px;
    }
    .topbar-menu.show { display: flex; }
    .topbar-menu a { padding: 10px 15px; }
    .container { padding: 15px; }
    .hero h1 { font-size: 24px; }
    .hero-actions { flex-direction: column; align-items: center; }
    .features { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .dashboard-header { flex-direction: column; text-align: center; }
    .user-stats { justify-content: center; }
    .action-bar { flex-direction: column; }
    .link-box, .code-box { flex-direction: column; text-align: center; }
}