:root {
    --primary: #4c78e8;
    --primary-dark: #3b64bf;
    --bg: #f4f6fb;
    --card: #ffffff;
    --text: #243041;
    --muted: #6b7280;
    --border: #e5eaf2;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Microsoft YaHei", Arial, sans-serif;
    background: linear-gradient(180deg, #f9fbff 0%, var(--bg) 100%);
    color: var(--text);
    line-height: 1.6;
}

header {
    background: linear-gradient(90deg, #fdfefe 0%, #f2f7ff 100%);
    border-bottom: 1px solid var(--border);
    padding: 40px 20px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.header-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

header h1 {
    margin: 0 0 6px;
    font-size: 2rem;
    color: var(--primary-dark);
    line-height: 1.2;
}

header p {
    margin: 0;
    color: var(--muted);
    line-height: 1.4;
}

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

.page-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.sidebar {
    width: 200px;
    flex-shrink: 0;
}

.sidebar-nav {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px 14px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 20px;
}

.sidebar-nav h3 {
    margin: 0 0 12px;
    font-size: 1rem;
    color: var(--primary-dark);
}

.sidebar-nav a {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f5f8ff;
    border: 1px solid #e7edff;
    color: var(--text);
    text-decoration: none;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: #edf4ff;
    color: var(--primary-dark);
    font-weight: 600;
}

.main-panel {
    flex: 1;
    min-width: 0;
}

.report-search-card {
    padding: 24px 20px 18px;
}

.report-toolbar {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    margin-bottom: 16px;
}

.search-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: nowrap;
    margin-bottom: 12px;
}

.search-box {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.search-box input {
    width: 100%;
    min-width: 0;
    height: 42px;
    padding: 0 12px;
    font-size: 0.95rem;
}

.search-row button {
    height: 42px;
    padding: 0 18px;
    white-space: nowrap;
}

.summary {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 0.92rem;
}

.report-table {
    min-width: 1400px;
}

@media (max-width: 1200px) {
    .search-box {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
    }
}

@media (max-width: 700px) {
    .search-row {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }

    .search-row button {
        width: 100%;
    }
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.section-heading {
    margin-bottom: 14px;
    text-align: center;
}

.section-heading h2,
.section-heading h1 {
    margin: 0 0 6px;
    font-size: 1.25rem;
    color: var(--primary-dark);
}

.section-heading p {
    margin: 0;
    color: var(--muted);
}

.header-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.extract-code {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid #dbe7ff;
    border-radius: 999px;
    background: #f7faff;
    color: var(--primary-dark);
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(76, 120, 232, 0.08);
}

.extract-code-label {
    font-weight: 600;
}

.extract-code strong {
    font-size: 1rem;
    letter-spacing: 0.12em;
    color: var(--primary-dark);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.table-wrapper {
    overflow-x: hidden;
}

.data-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.data-table th,
.data-table td {
    border: 1px solid var(--border);
    padding: 12px;
    vertical-align: top;
    word-break: break-word;
}

.data-table th {
    background: #f5f8ff;
    color: var(--primary-dark);
    font-weight: 700;
    text-align: left;
}

.data-table td {
    min-width: 0;
}

.result-content {
    min-height: 120px;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

.result-textarea {
    width: 100%;
    min-height: 120px;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    resize: vertical;
    font-size: 0.95rem;
    color: var(--text);
    background: #ffffff;
}

.result-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(76, 120, 232, 0.16);
}

.confirm-btn {
    margin-top: 10px;
    padding: 8px 12px;
    font-size: 0.92rem;
}

.hint-card {
    background: #f8fbff;
}

.hint-content {
    min-height: 60px;
    font-size: 0.95rem;
    color: var(--muted);
}

.hint-content p {
    margin: 0;
}

.hint-success {
    color: #15803d;
    font-weight: 600;
}

.hint-warning {
    color: #b45309;
    font-weight: 600;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

label {
    font-weight: 600;
    color: var(--text);
}

input {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    background: #fbfdff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(76, 120, 232, 0.16);
}

.form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.captcha-wrap {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.captcha-box {
    min-width: 120px;
    padding: 10px 14px;
    border: 1px dashed var(--primary);
    border-radius: 10px;
    background: linear-gradient(135deg, #fef3c7 0%, #fefefe 100%);
    color: var(--primary-dark);
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 4px;
    text-align: center;
    user-select: none;
}

.small-btn {
    padding: 10px 12px;
    white-space: nowrap;
}

.upload-area {
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 18px;
    text-align: center;
    background: linear-gradient(180deg, #fbfdff 0%, #f5f9ff 100%);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.upload-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.upload-area input[type="file"] {
    flex: 1;
    min-width: 180px;
    padding: 8px 0;
    background: transparent;
    border: none;
}

.upload-clear-btn {
    padding: 8px 12px;
    font-size: 0.92rem;
}

.upload-area.is-dragover {
    border-color: var(--primary);
    background: #eef4ff;
}

.upload-hint {
    margin-top: 8px;
    font-size: 0.95rem;
    color: var(--muted);
}

.upload-status {
    font-size: 0.95rem;
    color: var(--muted);
    white-space: pre-line;
}

.license-preview {
    margin-top: 8px;
    min-height: 40px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.license-preview img {
    width: 100%;
    max-height: 180px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.site-footer {
    padding: 18px 20px 24px;
    text-align: center;
    background: #f5f8ff;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.8;
}

.site-footer a {
    color: var(--primary-dark);
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s ease, background 0.2s ease;
}

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

button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #eef3ff;
    color: var(--primary-dark);
    border: 1px solid #dbe7ff;
}

.btn-secondary:hover {
    background: #e2ebff;
    transform: translateY(-1px);
}

@media (max-width: 1100px) {
    .data-table th,
    .data-table td {
        min-width: 180px;
    }
}

@media (max-width: 700px) {
    .data-table th,
    .data-table td {
        min-width: 160px;
    }
}

@media (max-width: 600px) {
    .card {
        padding: 18px;
    }

    .form-actions {
        flex-direction: column;
    }
}
