* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    --color-primary: #3883fa;
    --color-accent: #3883fa;
    --color-text: #515151;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    height: 100%;
    color: #374151;
    font-size: 14px;
    line-height: 1.5;
    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
}

body {
    display: flex;
    background: #f9fafb;
}

a {
    color: #3b82f6;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: #2563eb;
    text-decoration: none;
}

img {
    height: auto;
    max-width: 100%;
}

strong {
    font-weight: 700;
}

ul {
    display: block;
    padding: 0 16px;
    list-style: none;
}

li {
    list-style: none;
}

input[type=number] {
    -moz-appearance: textfield;
}

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

input[type=color] {
    padding: 0;
    border: none;
    outline: none;
    cursor: pointer;
}

input ::-webkit-color-swatch-wrapper {
    background: white;
}

input ::-webkit-color-swatch {
    position: relative;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

::-webkit-input-placeholder {
    color: #9ca3af;
}

::-moz-placeholder {
    color: #9ca3af;
}

:-moz-placeholder {
    color: #9ca3af;
}

:-ms-input-placeholder {
    color: #9ca3af;
}

h1, h2, h3 {
    font-weight: 600;
    line-height: 1.4;
    color: #1f2937;
}

h1 {
    font-size: 22px;
    padding-left: 12px;
    border-left: 3px solid #3b82f6;
}

h2 {
    font-size: 20px;
}

h3 {
    font-size: 16px;
}

.mt1 {
    margin-top: 12px;
}

.mt-2 {
    margin-top: 16px;
}

aside {
    overflow-y: auto;
    width: 240px;
    border-right: 1px solid #e5e7eb;
    background: #f9fafb;
    flex-shrink: 0;
}

main {
    flex: 1;
    overflow: auto;
    background: white;
}

.container {
    margin: 0 auto;
    min-width: 960px;
    max-width: 1440px;
    padding: 20px;
}

.side-nav {
    border-top: 1px solid #e5e7eb;
    line-height: 1.6em;
    padding: 10px 12px 16px 12px;
}

.side-nav p {
    margin-top: 10px;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    padding: 0 4px;
}

.side-nav p:first-child {
    margin-top: 0;
}

.side-nav ul {
    padding: 0;
    margin: 0;
}

.side-nav li {
    margin: 0;
    border-radius: 4px;
    transition: background-color 0.15s ease;
}

.side-nav li:hover {
    background-color: rgba(59, 130, 246, 0.08);
}

.side-nav li.active {
    color: #3b82f6;
    background-color: rgba(59, 130, 246, 0.12);
    border-right: none;
    font-weight: 500;
}

.side-nav a {
    color: #4b5563;
    display: block;
    padding: 3px 10px;
    text-decoration: none;
    border-radius: 4px;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.side-nav a:hover {
    text-decoration: none;
    color: #3b82f6;
    background-color: rgba(59, 130, 246, 0.05);
}

.logo a {
    color: #3b82f6;
    transition: opacity 0.15s ease;
}

.logo a:hover {
    opacity: 0.85;
}

aside .logo {
    cursor: pointer;
    font-weight: 700;
    font-size: 18px;
    text-align: center;
    padding: 16px 0;
    border-left: none;
    background-image: url('/static/img/logo.png');
    background-repeat: no-repeat;
    background-position: 16px center;
    background-size: 28px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 2px;
}

aside .logo a {
    color: #111827;
    text-decoration: none;
}

aside .logo a:hover {
    text-decoration: none;
    opacity: 0.8;
}

header, header .container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

header .container {
    display: flex;
    height: 40px;
    color: white;
    padding: 0 20px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

header .logo {
    font-size: 20px;
    color: white;
    font-weight: 600;
}

header .logo a {
    color: white;
    text-decoration: none;
}

header .logo a:hover {
    text-decoration: none;
    opacity: 0.9;
}

.nav-item {
    color: white;
    cursor: pointer;
    margin-left: 16px;
    transition: opacity 0.15s ease;
    text-decoration: none;
}

.nav-item:hover {
    opacity: 0.85;
    text-decoration: none;
}

.nav {
    justify-content: space-between;
}

.nav .item:hover {
    color: #f1f1f1;
}

footer {
    margin: 32px;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
}

.tile {
    padding: 12px 16px;
    background: #f9fafb;
    font-size: 14px;
    line-height: 32px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.text-info {
    color: #3b82f6 !important;
}

.text-success {
    color: #10b981 !important;
}

.text-error {
    color: #ef4444 !important;
}

.input, .textarea, input[type='checkbox'] {
    appearance: none;
    -moz-appearance: none;
    -webkit-appearance: none;
}

.input, .textarea, .button, input[type='checkbox'], .static, .select {
    border-radius: 6px;
    border: 1px solid #d1d5db;
    align-items: center;
    color: #374151;
    display: inline-flex;
    position: relative;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input, .textarea, .button, .file-cta, .file-name, .static, .select {
    outline: none;
    font-size: 14px;
    line-height: 18px;
    min-height: 34px;
}

.input, .textarea {
    max-width: 100%;
    width: 100%;
}

.input.error, .textarea.error {
    border: 1px solid #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.input, .textarea, .file-cta, .file-name {
    padding: 8px 12px;
    font-size: 14px;
    color: #374151;
}

.button, .file-cta, .file-name, .static {
    padding: 8px 16px;
    font-weight: 500;
}

.input:hover, .textarea:hover, input[type='checkbox']:hover, .select:hover {
    border-color: #9ca3af;
}

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

.input[disabled], .textarea[disabled] {
    background: #f3f4f6;
    border-color: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

.select {
    padding: 0 12px;
    flex-shrink: 0;
    cursor: pointer;
}

.static {
    flex-shrink: 0;
    background: #f9fafb;
}

.static:hover {
    border-color: #d1d5db !important;
}

.textarea {
    display: block;
    max-width: 100%;
    min-width: 100%;
    resize: vertical;
    line-height: 1.6;
}

.textarea.fixed-size {
    resize: none;
}

.help {
    font-size: 13px;
    line-height: 40px;
    color: #6b7280;
}

.button {
    cursor: pointer;
    background: white;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.button:hover {
    border-color: #9ca3af;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.button:active {
    background: #f9f9f9;
    transform: translateY(1px);
}

.button.primary {
    color: white;
    z-index: 3;
    border-color: #3b82f6;
    background: #3b82f6;
}

.button.primary:hover {
    background: #2563eb;
    border-color: #2563eb;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.fa {
    padding: 0 !important;
}

.button span:first-child {
    margin-right: 1em;
}

.button span:last-child {
    margin-left: 1em;
}

.content-center {
    display: flex;
    justify-content: center
}

.content-center *:not(:first-child) {
    margin-left: 1em;
}

.select {
    cursor: pointer;
}

.select option {
    font-size: 16px;
}

.checkbox {
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.checkbox input {
    position: relative !important;
    margin: 0 !important;
    width: 16px;
    height: 16px;
    color: white;
    outline: none;
    cursor: pointer;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.checkbox input:after {
    content: '✓';
}

.checkbox span {
    white-space: nowrap;
}

.checkbox input:checked {
    background: #3b82f6;
    border-color: #3b82f6;
}

.flex .checkbox:not(:first-child) {
    margin-left: 16px;
    word-break: keep-all;
}

.file, .file-zone {
    display: flex;
    cursor: pointer;
    overflow: hidden;
    position: relative;
}

.fullwidth .file-name {
    flex-grow: 1;
    max-width: none;
}

.file-zone {
    flex-direction: column;
    border-radius: 8px;
}

.file-input {
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    opacity: 0;
    position: absolute;
    outline: none;
    cursor: pointer;
}

.file-button {
    margin-left: 8px;
}

.file-cta, .file-name {
    display: flex;
    align-items: center;
    outline: none;
}

.file .file-cta {
    border-radius: 6px 0 0 6px;
    background: #3b82f6;
    color: white;
}

.file-zone .file-cta {
    flex-direction: column;
    height: auto;
    display: inline-flex;
    font-size: 20px;
    align-items: center;
    padding: 24px 48px;
    border-radius: 8px 8px 0 0;
    background: #3b82f6;
    color: white;
}

.file-cta:hover {
    background: #1d4ed8;
}

.file .file-name {
    border: 1px solid #d1d5db;
    border-left: none;
    border-radius: 0 6px 6px 0;
}

.file-zone .file-name {
    display: inline-flex;
    justify-content: center;
    border-radius: 0 0 8px 8px;
    border: solid #d1d5db;
    border-width: 0 1px 1px 1px;
    padding: 12px 0;
}

.file-zone .file-icon {
    margin-bottom: 12px;
    height: 24px;
    width: 24px;
}

table td, table th {
    vertical-align: top;
}

table td:not([align]),
table th:not([align]) {
    text-align: left;
}

.table {
    border-collapse: collapse;
    border-spacing: 0;
    word-break: break-all;
    font-size: 14px;
}

.table td, .table th {
    border: 1px solid #e5e7eb;
    padding: 8px 12px;
}

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

.table.fullwidth {
    display: table;
}

.table.divide {
    table-layout: fixed
}

.table.striped thead tr, .table.striped tbody tr:nth-child(even) {
    background: #f9fafb;
}

.table code {
    background: transparent;
}

.progress {
    -moz-appearance: none;
    -webkit-appearance: none;
    border: none;
    border-radius: 8px;
    display: block;
    height: 8px;
    overflow: hidden;
    padding: 0;
    width: 100%;
}

.progress::-webkit-progress-bar {
    background: #e5e7eb;
}

.progress::-webkit-progress-value {
    background: #3b82f6;
}

.progress::-moz-progress-bar {
    background: #3b82f6;
}

.progress::-ms-fill {
    background: #3b82f6;
    border: none;
}

.tag {
    background: #eff6ff;
    border-radius: 16px;
    color: #3b82f6;
    display: inline-block;
    font-size: 12px;
    height: 28px;
    line-height: 28px;
    padding: 0 12px;
    white-space: nowrap;
    font-weight: 500;
}

.tag {
    margin-right: 16px;
}

.content h1,
.content h2,
.content h3,
.content h4 {
    margin-bottom: 12px;
    color: #1f2937;
}

.content li + li {
    margin-top: 4px;
}

.content p:not(:last-child),
.content ol:not(:last-child),
.content ul:not(:last-child),
.content pre:not(:last-child),
.content table:not(:last-child) {
    margin-bottom: 16px;
}

.flex {
    display: flex;
}

.inline {
    width: auto;
    display: inline;
}

.bordered {
    border-radius: 6px;
    border: 1px solid #d1d5db;
}

.fullwidth {
    width: 100%;
}

.fullHeight {
    height: 100%;
}

.group {
    display: inline-flex;
}

.group * {
    border-radius: 0;
}

.group *:not(:first-child) {
    margin-left: -1px;
}

.group *:first-child {
    border-radius: 6px 0 0 6px;
}

.group *:last-child {
    border-radius: 0 6px 6px 0;
}

.group *:not(.primary):hover {
    z-index: 3;
    border-color: #9ca3af;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.group *:focus {
    z-index: 4;
}

.mid-menus {
    align-items: center;
    justify-content: center;
    width: 130px;
    display: flex;
    padding: 0 16px;
}

.mid-menus * {
    width: 100%;
}

.mid-menus .button {
    margin: 0;
}

.mid-menus .button:not(:first-child) {
    margin-top: 16px;
}

.tools {
    margin-bottom: 16px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

@media screen and (max-width: 1200px) {
    aside {
        display: none;
    }

    .tools {
        grid-template-columns: repeat(3, 1fr);
    }
}

.tool {
    cursor: pointer;
    padding: 16px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
}

.tool:hover {
    text-decoration: none;
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.12);
    transform: translateY(-1px);
}

.tool :first-child {
    color: #1f2937;
    font-weight: 600;
    margin-bottom: 6px;
}

.tool :last-child {
    color: #6b7280;
    font-size: 13px;
}

.tool :last-child:hover {
    text-decoration: none;
    color: #3b82f6;
}

.editarea {
    width: 1px;
    height: 90vh;
    flex-grow: 1;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    overflow: hidden;
}

.editarea .textarea {
    border: none;
    border-radius: 0;
}

/* 全局滚动条样式 - 火狐 */
* {
    scrollbar-width: thin;
    scrollbar-color: #d1d5db transparent;
}

/* 全局滚动条样式 - WebKit (Chrome/Safari/Edge) */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

::-webkit-scrollbar-corner {
    background: transparent;
}
