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

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --bg-color: #ffffff;
    --bg-light: #f8fafc;
    --bg-dark: #1e293b;
    --text-color: #334155;
    --text-light: #94a3b8;
    --border-color: #e2e8f0;
    --code-bg: #1e1e1e;
    --code-text: #d4d4d4;
    --success-color: #10b981;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--bg-color);
}

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

/* Header */
.header {
    background: var(--bg-dark);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

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

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.tagline {
    font-size: 0.85rem;
    color: var(--text-light);
}

.nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav a {
    color: white;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav a:hover {
    color: var(--primary-color);
}

.lang-select {
    background: transparent;
    border: 1px solid var(--text-light);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    outline: none;
}

.lang-select:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.lang-select option {
    background: var(--bg-dark);
    color: white;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--bg-dark) 0%, #334155 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-desc {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
    color: var(--text-light);
}

/* Features Section */
.features {
    padding: 4rem 0;
    background: var(--bg-light);
}

.features h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
}

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

.feature-card {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.feature-card p {
    color: var(--secondary-color);
}

/* Usage Guide Section */
.usage-guide {
    padding: 4rem 0;
}

.usage-guide h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
}

.usage-step {
    margin-bottom: 3rem;
}

.usage-step h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.usage-step p {
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

.import-tip {
    background: var(--bg-light);
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
    border-radius: 4px;
    margin-top: 1rem;
}

.import-tip p {
    margin: 0;
    color: var(--secondary-color);
    font-size: 1rem;
}

/* Carousel */
.carousel {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: var(--bg-light);
}

.carousel-inner {
    position: relative;
}

.carousel-item {
    display: none;
}

.carousel-item.active {
    display: block;
}

.carousel-item img {
    width: 100%;
    height: auto;
    display: block;
}

.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 1rem 0.75rem;
    cursor: pointer;
    font-size: 1.5rem;
    transition: background 0.2s;
    z-index: 10;
}

.carousel-control:hover {
    background: rgba(0, 0, 0, 0.8);
}

.carousel-control.prev {
    left: 0;
}

.carousel-control.next {
    right: 0;
}

.carousel-indicators {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.2s;
}

.indicator.active {
    background: white;
}

/* Code Demo */
.code-demo {
    background: var(--code-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.code-header {
    background: #2d2d2d;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

.code-actions {
    display: flex;
    gap: 0.5rem;
}

.code-actions button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.code-actions button:hover {
    background: var(--primary-dark);
}

.code-block {
    padding: 1.5rem;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--code-text);
}

/* Edit Link */
.edit-link-container {
    text-align: center;
    padding: 2rem;
}

.edit-link {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    transition: background 0.2s, transform 0.2s;
}

.edit-link:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Templates Preview */
.templates-preview {
    padding: 4rem 0;
    background: var(--bg-light);
}

.templates-preview h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.templates-desc {
    text-align: center;
    color: var(--secondary-color);
    margin-bottom: 2rem;
}

.template-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.template-group-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.template-group-card h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.template-group-card ul {
    list-style: none;
    padding: 0;
}

.template-group-card li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

.template-group-card li:last-child {
    border-bottom: none;
}

.view-all-container {
    text-align: center;
}

.btn-primary {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
}

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

/* Editor Page */
.editor-page {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

.editor-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    height: calc(100vh - 200px);
}

.template-sidebar {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    overflow-y: auto;
}

.template-sidebar h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.template-tree {
    font-size: 0.95rem;
}

.tree-group {
    margin-bottom: 0.5rem;
}

.tree-group-header {
    padding: 0.5rem;
    background: var(--bg-light);
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
}

.tree-group-header:hover {
    background: var(--border-color);
}

.tree-group-header::before {
    content: '▶';
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.tree-group.expanded > .tree-group-header::before {
    transform: rotate(90deg);
}

.tree-items {
    display: none;
    padding-left: 1rem;
}

.tree-group.expanded > .tree-items {
    display: block;
}

.tree-item {
    padding: 0.4rem 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
}

.tree-item:hover {
    background: var(--bg-light);
}

.tree-item.active {
    background: var(--primary-color);
    color: white;
}

.editor-main {
    display: flex;
    flex-direction: column;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.editor-header {
    background: var(--bg-light);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.editor-header h3 {
    color: var(--primary-color);
}

.editor-actions {
    display: flex;
    gap: 0.5rem;
}

.json-editor {
    flex: 1;
    padding: 1rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    border: none;
    resize: none;
    background: var(--code-bg);
    color: var(--code-text);
    outline: none;
}

.editor-status {
    padding: 0.5rem 1rem;
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--secondary-color);
}

/* Footer */
.footer {
    background: var(--bg-dark);
    color: var(--text-light);
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero h2 {
        font-size: 1.75rem;
    }

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

    .editor-container {
        grid-template-columns: 1fr;
        height: auto;
    }

    .template-sidebar {
        max-height: 300px;
    }

    .json-editor {
        min-height: 400px;
    }
}

/* Privacy Policy Page */
.privacy-policy {
    padding: 3rem 0 4rem;
    background: var(--bg-light);
    min-height: calc(100vh - 200px);
}

.privacy-policy h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    text-align: center;
}

.privacy-effective-date,
.privacy-software-name {
    text-align: center;
    color: var(--secondary-color);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.privacy-software-name {
    margin-bottom: 2.5rem;
}

.privacy-section {
    background: white;
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.privacy-section h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.privacy-section h3 {
    font-size: 1.15rem;
    color: var(--text-color);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.privacy-section p {
    margin-bottom: 1rem;
    line-height: 1.8;
    color: var(--text-color);
}

.privacy-section ul,
.privacy-section ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.privacy-section li {
    margin-bottom: 0.75rem;
    line-height: 1.8;
    color: var(--text-color);
}

.privacy-section ol li {
    list-style-type: decimal;
}

.privacy-section ul li {
    list-style-type: disc;
}

/* Highlight Email */
.highlight-email {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.highlight-email:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}