:root {
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    --color-text: #1e293b;
    --color-text-secondary: #64748b;
    --color-border: #e2e8f0;
    --color-accent: #f59e0b;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
    --max-width: 1100px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}
a:hover {
    color: var(--color-primary-hover);
}

.layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-link {
    display: flex;
    align-items: center;
}

.logo {
    height: 36px;
    width: auto;
}

.nav {
    display: flex;
    gap: 8px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: var(--radius);
    color: var(--color-text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}
.nav-link:hover {
    color: var(--color-primary);
    background: #eff6ff;
}
.nav-link.active {
    color: var(--color-primary);
    background: #eff6ff;
}

/* Main */
.main {
    flex: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 32px 20px;
    width: 100%;
}

/* Footer */
.footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 24px 0;
    margin-top: auto;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.friend-links {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
}

.footer-label {
    color: var(--color-text-secondary);
}

.friend-link {
    color: var(--color-primary);
    padding: 4px 10px;
    border-radius: 4px;
    transition: background 0.2s;
}
.friend-link:hover {
    background: #eff6ff;
}

.footer-info {
    color: var(--color-text-secondary);
    font-size: 12px;
}
.footer-info p {
    margin: 0;
}

/* Hero Section (Home) */
.home-container {
    max-width: 780px;
    margin: 0 auto;
}

.hero-section {
    text-align: center;
    padding: 48px 0 32px;
}

.hero-icon {
    margin-bottom: 16px;
}

.hero-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 12px;
}

.hero-desc {
    font-size: 16px;
    color: var(--color-text-secondary);
    margin-bottom: 32px;
}

/* Search Form */
.search-form {
    margin-bottom: 24px;
}

.detail-search {
    margin-bottom: 32px;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: 50px;
    padding: 4px 4px 4px 20px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow);
}
.search-box:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.search-icon {
    color: var(--color-text-secondary);
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 12px;
    font-size: 15px;
    background: transparent;
    color: var(--color-text);
}
.search-input::placeholder {
    color: #94a3b8;
}

.search-btn {
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 10px 28px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}
.search-btn:hover {
    background: var(--color-primary-hover);
}

/* 搜索按钮加载状态（请求处理中） */
.search-btn:disabled {
    cursor: not-allowed;
    opacity: 0.8;
}
.search-btn.search-btn-loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: not-allowed;
}
.search-btn-loading .spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: search-spin 0.7s linear infinite;
    flex-shrink: 0;
}
@keyframes search-spin {
    to { transform: rotate(360deg); }
}

/* Intro Section */
.intro-section {
    text-align: center;
    padding: 24px 0 32px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--color-text);
}

.intro-text {
    color: var(--color-text-secondary);
    font-size: 14px;
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.8;
}

/* Latest Section */
.latest-section {
    padding-top: 16px;
}

.latest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.latest-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--color-text);
    transition: all 0.2s;
}
.latest-item:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.item-type-badge {
    font-size: 14px;
    flex-shrink: 0;
}

.item-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Detail Page */
.detail-container {
    max-width: 680px;
    margin: 0 auto;
}

.info-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 32px;
    box-shadow: var(--shadow);
}

.info-card-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
}

.info-table {
    width: 100%;
    border-collapse: collapse;
}

.info-table tr {
    border-bottom: 1px solid #f1f5f9;
}
.info-table tr:last-child {
    border-bottom: none;
}

.info-label {
    padding: 14px 16px 14px 0;
    color: var(--color-text-secondary);
    font-size: 14px;
    width: 120px;
    white-space: nowrap;
}

.info-value {
    padding: 14px 0;
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text);
    word-break: break-all;
}

.licence-badge {
    display: inline-block;
    background: #eff6ff;
    color: var(--color-primary);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
}

/* Table Page (NewBa / BeiAn) */
.table-container {
    max-width: var(--max-width);
    margin: 0 auto;
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--color-primary);
    display: inline-block;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}

.filter-label {
    font-size: 13px;
    color: var(--color-text-secondary);
    white-space: nowrap;
    margin-right: 4px;
}

.filter-tag {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
    transition: all 0.2s;
    white-space: nowrap;
}
.filter-tag:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
}
.filter-tag.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* Data Hint (列表页提示条) */
.data-hint {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #eff6ff;
    border: 1px dashed var(--color-primary);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--color-text-secondary);
}

.data-hint-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.data-hint-text {
    color: var(--color-text-secondary);
}

.data-hint-text strong {
    color: var(--color-text);
    font-weight: 600;
}

.data-hint-link {
    color: var(--color-primary);
    font-weight: 700;
    text-decoration: underline;
}
.data-hint-link:hover {
    color: var(--color-primary-hover);
}

/* Detail Banner Ad (详情页横幅广告) */
.ad-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
    border-radius: 12px;
    color: #ffffff;
    text-decoration: none;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}
.ad-banner::after {
    content: "";
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(15deg);
    pointer-events: none;
}
.ad-banner:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: #ffffff;
}

.ad-banner-icon {
    font-size: 32px;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.2);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-banner-content {
    flex: 1;
    min-width: 0;
}

.ad-banner-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
}

.ad-banner-desc {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 2px;
}

.ad-banner-url {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.ad-banner-arrow {
    font-size: 32px;
    font-weight: 300;
    flex-shrink: 0;
    opacity: 0.9;
}

/* Table */
.table-wrapper {
    overflow-x: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    background: #f8fafc;
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--color-text-secondary);
    font-size: 13px;
    border-bottom: 2px solid var(--color-border);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
}
.type-site { background: #eff6ff; color: var(--color-primary); }
.type-app { background: #fef3c7; color: #b45309; }
.type-mini { background: #d1fae5; color: #047857; }
.type-quick { background: #ede9fe; color: #6d28d9; }

/* Subject Badge */
.subject-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
}
.subject-personal { background: #fce7f3; color: #be185d; }
.subject-enterprise { background: #dbeafe; color: #1d4ed8; }
.subject-other { background: #f3f4f6; color: #6b7280; }

/* New table column widths */
.data-table.new-cols th:nth-child(1) { min-width: 90px; }
.data-table.new-cols th:nth-child(2) { min-width: 140px; }
.data-table.new-cols th:nth-child(3) { min-width: 60px; }
.data-table.new-cols th:nth-child(4) { min-width: 180px; }
.data-table.new-cols th:nth-child(5) { min-width: 130px; }
.data-table.new-cols th:nth-child(6) { min-width: 90px; }

.licence-cell { font-size: 13px; word-break: break-all; max-width: 220px; }
.time-cell { white-space: nowrap; }

.item-link {
    font-weight: 500;
}

/* Pagination */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    margin-top: 8px;
    flex-wrap: wrap;
    gap: 12px;
}

.pagination-info {
    font-size: 13px;
    color: var(--color-text-secondary);
}

.pagination-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--color-text);
    background: var(--color-surface);
    transition: all 0.2s;
}
.page-link:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}
.page-link.current {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* Not Found */
.not-found-container {
    text-align: center;
    padding: 80px 20px;
}

.not-found-title {
    font-size: 24px;
    color: var(--color-text);
    margin: 24px 0 12px;
}

.not-found-desc {
    color: var(--color-text-secondary);
    font-size: 15px;
    margin-bottom: 32px;
}

.back-btn {
    display: inline-block;
    padding: 12px 32px;
    background: var(--color-primary);
    color: white;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.2s;
}
.back-btn:hover {
    background: var(--color-primary-hover);
    color: white;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-text {
    margin-top: 16px;
    color: var(--color-text-secondary);
    font-size: 15px;
}

/* Responsive */
@media (max-width: 640px) {
    .main {
        padding: 24px 12px;
    }

    .header-inner {
        padding: 0 12px;
    }

    .hero-section {
        padding: 32px 0 24px;
    }

    .hero-title {
        font-size: 24px;
    }

    .hero-desc {
        font-size: 14px;
        margin-bottom: 24px;
    }

    .search-input {
        font-size: 14px;
    }

    .nav-link {
        padding: 6px 10px;
        font-size: 13px;
    }

    .latest-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .latest-item {
        padding: 8px 10px;
        font-size: 12px;
    }

    .info-card {
        padding: 20px;
    }

    .info-card-title {
        font-size: 18px;
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .info-label {
        width: 80px;
        font-size: 13px;
        padding: 10px 8px 10px 0;
    }

    .info-value {
        font-size: 14px;
        padding: 10px 0;
    }

    .pagination-bar {
        flex-direction: column;
        align-items: center;
    }

    .pagination-info {
        font-size: 12px;
    }

    .page-link {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
        padding: 0 6px;
    }

    .filter-bar {
        gap: 4px;
        padding: 8px 10px;
    }

    .filter-tag {
        font-size: 12px;
        padding: 3px 8px;
    }

    .data-hint {
        padding: 10px 12px;
        font-size: 13px;
    }

    .ad-banner {
        gap: 12px;
        padding: 16px;
    }
    .ad-banner-icon {
        font-size: 24px;
        width: 44px;
        height: 44px;
    }
    .ad-banner-title {
        font-size: 15px;
    }
    .ad-banner-url {
        font-size: 13px;
    }

    .search-box {
        padding: 2px 2px 2px 14px;
    }

    .search-btn {
        padding: 8px 18px;
        font-size: 13px;
    }

    .data-table {
        font-size: 13px;
    }

    .data-table th,
    .data-table td {
        padding: 8px 10px;
    }

    .data-table.new-cols th:nth-child(4) {
        min-width: 140px;
    }

    .licence-cell {
        max-width: 140px;
        font-size: 12px;
    }

    .not-found-container {
        padding: 40px 20px;
    }

    .not-found-title {
        font-size: 20px;
    }

    .not-found-desc {
        font-size: 14px;
    }

    .back-btn {
        padding: 10px 24px;
        font-size: 14px;
    }

    .empty-state {
        padding: 40px 16px;
    }
}

@media (max-width: 480px) {
    .filter-bar {
        justify-content: flex-start;
    }
    .filter-label {
        width: 100%;
        margin-bottom: 4px;
    }
    .filter-tag {
        font-size: 11px;
        padding: 2px 6px;
    }
    .data-table th,
    .data-table td {
        padding: 6px 8px;
        font-size: 12px;
    }
    .data-table.new-cols th:nth-child(4) {
        min-width: 120px;
    }
    .licence-cell {
        max-width: 120px;
        font-size: 12px;
    }
    .latest-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }
    .latest-item {
        padding: 6px 8px;
        font-size: 11px;
    }
    .hero-title {
        font-size: 20px;
    }
    .hero-section {
        padding: 24px 0 16px;
    }
}
