* {
    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;
}

.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 2rem;
}

#wx_login_container {
    min-width: 300px;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-header {
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    padding: 0 1.5rem;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header h1 {
    font-size: 1.2rem;
    font-weight: 600;
}

.app-content {
    width: min(960px, 92%);
    margin: 1.5rem auto;
    padding: 0 1rem 2rem;
}

.panel {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
}

.panel h2 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.time-options-panel {
    border: 1px solid #d6e4ff;
    border-radius: 8px;
    padding: 1rem 1.1rem 0.75rem;
    background: #f0f5ff;
}

.time-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.time-options-panel .time-options {
    margin-bottom: 0;
}

.time-options-panel .custom-range {
    margin-top: 0.75rem;
}

.time-options-panel .form-inline .form-row {
    margin-bottom: 0;
}

.time-options-panel .form-inline .form-row:last-child {
    margin-bottom: 0;
}

.time-option {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.time-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.time-option span {
    display: inline-block;
    padding: 0.4rem 0.85rem;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    background: #fff;
    font-size: 0.875rem;
    color: #333;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.time-option input:checked + span {
    border-color: #1677ff;
    background: #1677ff;
    color: #fff;
}

.time-option input:focus-visible + span {
    outline: 2px solid rgba(22, 119, 255, 0.35);
    outline-offset: 1px;
}

.custom-range {
    padding-top: 0;
}

.custom-range[hidden] {
    display: none;
}

.results-hint {
    font-size: 0.8125rem;
    color: #888;
    margin: -0.5rem 0 1rem;
}

.form-row {
    margin-bottom: 1rem;
}

.form-row label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
    color: #555;
}

.form-row .hint {
    font-size: 0.75rem;
    color: #888;
    margin-top: 0.25rem;
}

input[type="text"],
input[type="datetime-local"],
textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
}

textarea {
    min-height: 80px;
    resize: vertical;
}

input[type="text"]:focus,
input[type="datetime-local"]:focus,
textarea:focus {
    outline: none;
    border-color: #1677ff;
    box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.15);
}

.form-inline {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-inline .form-row {
    flex: 1;
    min-width: 200px;
}

.content-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.content-list-header label {
    margin-bottom: 0;
}

.content-list-panel {
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    max-height: 260px;
    overflow-y: auto;
    background: #fff;
}

.content-list-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1.4;
}

.content-list-item:last-child {
    border-bottom: none;
}

.content-list-item:hover {
    background: #fafafa;
}

.content-list-item input[type="checkbox"] {
    width: auto;
    flex-shrink: 0;
    margin: 0;
    cursor: pointer;
}

.content-list-status {
    padding: 0.75rem;
    font-size: 0.875rem;
    color: #888;
}

.content-list-error {
    color: #cf1322;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-primary {
    background: #1677ff;
    color: #fff;
}

.btn-primary:hover {
    background: #4096ff;
}

.btn-primary:disabled {
    background: #91caff;
    cursor: not-allowed;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8125rem;
    background: #f0f0f0;
    color: #666;
}

.btn-sm:hover {
    background: #e0e0e0;
}

.btn-sm:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.alert-error {
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #cf1322;
}

.alert-info {
    background: #e6f4ff;
    border: 1px solid #91caff;
    color: #0958d9;
}

.results-empty {
    text-align: center;
    color: #888;
    padding: 2rem 1rem;
    font-size: 0.875rem;
}

.result-card {
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    background: #fafafa;
}

.result-card h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.result-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    height: 1.75rem;
    border-radius: 4px;
    background: #1677ff;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
}

.usage-score {
    display: inline-flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #fff;
    border: 1px solid #91caff;
    border-radius: 6px;
}

.usage-score .label {
    font-size: 0.8125rem;
    color: #666;
}

.usage-score .value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0958d9;
}

.badge {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-ok {
    background: #f6ffed;
    color: #389e0d;
    border: 1px solid #b7eb8f;
}

.badge-missing {
    background: #fff7e6;
    color: #d46b08;
    border: 1px solid #ffd591;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.stat-item {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 0.6rem 0.75rem;
}

.stat-item .label {
    font-size: 0.75rem;
    color: #888;
}

.stat-item .value {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a1a1a;
}
