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

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #06b6d4;
    --accent: #f59e0b;
    --success: #10b981;
    --info: #3b82f6;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.4);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
    padding: 16px 0;
    transition: var(--transition);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
}

.nav-brand i {
    color: var(--primary);
    font-size: 1.6rem;
}

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

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text);
    background: rgba(99, 102, 241, 0.15);
}

.nav-btn {
    background: var(--primary) !important;
    color: white !important;
    padding: 8px 20px !important;
    border-radius: var(--radius-sm) !important;
    font-weight: 600 !important;
}

.nav-btn:hover {
    background: var(--primary-dark) !important;
    transform: translateY(-1px);
}

.admin-btn {
    background: var(--accent) !important;
}
.admin-btn:hover {
    background: #d97706 !important;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.8rem;
    cursor: pointer;
    padding: 4px;
}

/* 英雄区 */
.hero {
    padding: 140px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(6, 182, 212, 0.06) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -1px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 40px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary-light);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* 工具区 */
.tool-section {
    padding: 60px 0;
}

.tool-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}

.tool-header {
    padding: 24px 32px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.tool-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tool-header h2 i {
    color: var(--primary);
}

.tool-options {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: var(--transition);
}

.option-item:hover {
    color: var(--text);
}

.option-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.tool-body {
    padding: 32px;
}

.input-group,
.output-group {
    margin-bottom: 20px;
}

.input-group label,
.output-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

textarea {
    width: 100%;
    min-height: 200px;
    padding: 16px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
    transition: var(--transition);
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

textarea[readonly] {
    background: var(--bg-card-hover);
    cursor: default;
}

.tool-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.result-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: inherit;
}

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

.btn:active {
    transform: translateY(0);
}

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

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

.btn-secondary {
    background: var(--bg-card-hover);
    color: var(--text);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-outline {
    background: transparent;
    color: var(--text-muted);
    border: 2px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-info {
    background: var(--info);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: #1e293b;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* 功能特点 */
.features {
    padding: 80px 0;
    background: linear-gradient(180deg, var(--bg) 0%, rgba(15, 23, 42, 0.5) 100%);
}

.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 48px;
    letter-spacing: -0.5px;
}

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

.feature-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 32px;
    text-align: center;
    border: 1px solid var(--border);
    transition: var(--transition);
}

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

.feature-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(6, 182, 212, 0.2));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--primary-light);
}

.feature-card h3 {
    font-size: 1.15rem;
    margin-bottom: 8px;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* 历史记录 */
.history {
    padding: 80px 0;
}

.history-list {
    display: grid;
    gap: 16px;
}

.history-item {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px 24px;
    border: 1px solid var(--border);
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.history-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.history-info {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.history-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.history-badge {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.history-preview {
    flex: 1;
}

.history-preview pre {
    font-size: 0.8rem;
    color: var(--text-muted);
    max-height: 60px;
    overflow: hidden;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    word-break: break-all;
}

.history-actions {
    flex-shrink: 0;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.1rem;
}

/* 弹窗 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 400px;
    width: 100%;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    position: relative;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

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

.modal-content h2 {
    font-size: 1.4rem;
    margin-bottom: 24px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.95rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 32px 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
}

/* 管理后台 */
.admin-body {
    padding-top: 80px;
}

.admin-nav {
    background: rgba(15, 23, 42, 0.95) !important;
}

.admin-dashboard {
    padding: 40px 0;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.admin-header h1 {
    font-size: 1.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-stats {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.admin-stats strong {
    color: var(--primary-light);
}

.admin-toolbar {
    margin-bottom: 20px;
}

.admin-list {
    display: grid;
    gap: 16px;
}

.admin-item {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 20px 24px;
    border: 1px solid var(--border);
}

.admin-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-time {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.admin-badge {
    background: rgba(6, 182, 212, 0.15);
    color: var(--secondary);
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.admin-item-preview {
    margin-bottom: 12px;
}

.admin-item-preview strong {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.admin-item-preview pre {
    font-size: 0.8rem;
    color: var(--text-muted);
    max-height: 60px;
    overflow: hidden;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    word-break: break-all;
    margin-bottom: 8px;
    padding: 8px;
    background: var(--bg);
    border-radius: 6px;
}

.admin-item-actions {
    display: flex;
    gap: 8px;
}

/* Toast 通知 */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-card);
    color: var(--text);
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    font-size: 0.9rem;
    z-index: 3000;
    animation: slideIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.success {
    border-color: var(--success);
}

.toast.error {
    border-color: var(--danger);
}

.toast.info {
    border-color: var(--info);
}

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

/* 响应式 */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .hero-stats {
        gap: 24px;
    }

    .stat-number {
        font-size: 1.6rem;
    }

    .tool-header {
        padding: 16px 20px;
        flex-direction: column;
        align-items: flex-start;
    }

    .tool-body {
        padding: 20px;
    }

    .tool-options {
        gap: 10px;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-card);
        flex-direction: column;
        padding: 16px;
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
    }

    .nav-links.active {
        display: flex;
    }

    .hamburger {
        display: block;
    }

    .history-item {
        flex-direction: column;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .tool-actions,
    .result-actions {
        flex-direction: column;
    }

    .tool-actions .btn,
    .result-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .modal-content {
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.8rem;
    }

    .hero-stats {
        gap: 16px;
    }

    .stat-item {
        min-width: 80px;
    }
}