/* Jcseg 中文分词工具样式表 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

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

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 24px;
}

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

.logo img {
    width: 40px;
    height: 40px;
}

.logo-text {
    font-size: 24px;
    font-weight: bold;
    color: #1f2937;
}

.header-links {
    display: flex;
    gap: 12px;
    align-items: center;
}

.file-upload-btn {
    padding: 8px 16px;
    background: #3b82f6;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.file-upload-btn:hover {
    background: #2563eb;
}

#file-upload {
    display: none;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: #e5e7eb;
    color: #4b5563;
    border-radius: 6px 6px 0 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: #d1d5db;
}

.tab-btn.active {
    background: #3b82f6;
    color: white;
}

/* Main Content */
.main-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 24px;
    margin-bottom: 32px;
}

/* Input Section */
.input-section {
    margin-bottom: 24px;
}

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.input-label {
    font-weight: 600;
    color: #374151;
}

.char-count {
    font-size: 12px;
    color: #6b7280;
}

.text-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 150px;
    transition: border-color 0.2s;
}

.text-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Options Panel */
.options-panel {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 6px;
}

.options-panel.hidden {
    display: none;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.option-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.option-select,
.option-input {
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    min-width: 120px;
}

.option-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
}

/* Action Bar */
.action-bar {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.btn {
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-primary:disabled {
    background: #93c5fd;
    cursor: not-allowed;
}

.btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.btn-secondary:hover {
    background: #d1d5db;
}

.btn-copy,
.btn-download {
    background: #10b981;
    color: white;
    padding: 6px 12px;
    font-size: 12px;
}

.btn-copy:hover,
.btn-download:hover {
    background: #059669;
}

.btn-text,
.btn-loading {
    display: inline;
}

.btn-loading.hidden {
    display: none;
}

.hidden {
    display: none !important;
}

/* Result Section */
.result-section {
    margin-top: 24px;
    border-top: 1px solid #e5e7eb;
    padding-top: 24px;
}

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

.result-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.result-meta {
    display: flex;
    gap: 12px;
    align-items: center;
}

.result-time {
    font-size: 12px;
    color: #6b7280;
}

.result-content {
    min-height: 100px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-all;
}

.result-placeholder {
    color: #9ca3af;
    text-align: center;
    padding: 40px 0;
}

/* Word Cloud */
.wordcloud-container {
    width: 100%;
    text-align: center;
}

.wordcloud-container canvas {
    max-width: 100%;
    height: auto;
}

/* Guide Sections */
.jcseg-guide {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.jcseg-guide h2 {
    font-size: 20px;
    color: #1f2937;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e5e7eb;
}

.jcseg-guide h3 {
    font-size: 16px;
    color: #374151;
    margin: 16px 0 8px;
}

.jcseg-guide p {
    color: #4b5563;
    margin-bottom: 12px;
}

.jcseg-guide__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.jcseg-guide__card {
    padding: 16px;
    background: #f9fafb;
    border-radius: 6px;
    border-left: 4px solid #3b82f6;
}

.jcseg-guide__card h3 {
    margin-top: 0;
}

.jcseg-guide__table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.jcseg-guide__table th,
.jcseg-guide__table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.jcseg-guide__table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.jcseg-guide__code {
    background: #1f2937;
    color: #e5e7eb;
    padding: 16px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    overflow-x: auto;
    margin-top: 16px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.toast.hidden {
    display: none;
}

/* Footer */
.footer {
    text-align: center;
    padding: 24px 0;
    color: #6b7280;
    font-size: 14px;
    border-top: 1px solid #e5e7eb;
    margin-top: 32px;
}

.friend-links {
    margin-top: 12px;
}

.friend-links a {
    color: #3b82f6;
    text-decoration: none;
    margin: 0 8px;
}

.friend-links a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }

    .header {
        flex-direction: column;
        gap: 12px;
    }

    .nav-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .tab-btn {
        white-space: nowrap;
    }

    .action-bar {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .jcseg-guide__grid {
        grid-template-columns: 1fr;
    }
}
