* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    font-size: 14px;
    color: #333;
    background: #f5f5f5;
    line-height: 1.6;
}

a {
    color: #c00000;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    width: 1200px;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 15px;
}

.site-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.site-header {
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    padding: 15px 0;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.brand .logo {
    font-size: 28px;
    font-weight: bold;
    color: #c00000;
    text-decoration: none;
}

.brand .site-url {
    font-size: 12px;
    color: #999;
}

.city-info .city-name {
    font-size: 16px;
    color: #333;
    font-weight: bold;
}

.header-search {
    flex: 1;
    min-width: 200px;
}

.quick-search-form {
    display: flex;
    gap: 8px;
}

.quick-search-form input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.contact-info {
    text-align: right;
}

.contact-label {
    display: block;
    font-size: 12px;
    color: #999;
}

.contact-phone {
    font-size: 22px;
    font-weight: bold;
    color: #c00000;
    text-decoration: none;
}

.contact-wechat {
    font-size: 12px;
    color: #666;
}

/* Nav */
.main-nav {
    background: #c00000;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
}

.nav-list li a {
    display: block;
    padding: 12px 18px;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
}

.nav-list li a:hover,
.nav-list li.active a {
    background: #a00000;
    text-decoration: none;
}

/* Main content */
.main-content {
    flex: 1;
    padding: 20px 0 40px;
}

/* Filter panel */
.filter-panel {
    background: #fff;
    border: 1px solid #e5e5e5;
    margin-bottom: 15px;
}

.filter-row {
    display: flex;
    border-bottom: 1px solid #f0f0f0;
    padding: 10px 15px;
    align-items: flex-start;
}

.filter-row:last-child {
    border-bottom: none;
}

.filter-label {
    width: 90px;
    flex-shrink: 0;
    color: #666;
    padding-top: 4px;
    font-weight: bold;
}

.filter-content {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.filter-link {
    display: inline-block;
    padding: 3px 10px;
    color: #333;
    border-radius: 2px;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
}

.filter-link:hover {
    color: #c00000;
    text-decoration: none;
}

.filter-link.active {
    background: #c00000;
    color: #fff;
}

.precise-inputs {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
}

.precise-inputs input {
    width: 32px;
    height: 32px;
    text-align: center;
    border: 1px solid #ddd;
    font-size: 14px;
}

.precise-sep {
    color: #999;
    margin: 0 2px;
}

.filter-input {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    min-width: 150px;
}

.filter-select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 6px 16px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: #c00000;
    border-color: #c00000;
    color: #fff;
}

.btn-primary:hover {
    background: #a00000;
}

.btn-sm {
    padding: 3px 10px;
    font-size: 12px;
}

/* Sort bar */
.sort-bar {
    background: #fff;
    border: 1px solid #e5e5e5;
    padding: 10px 15px;
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.sort-bar .btn.active {
    background: #c00000;
    border-color: #c00000;
    color: #fff;
}

/* Number list */
.number-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: #fff;
    border: 1px solid #e5e5e5;
}

.number-item {
    display: grid;
    grid-template-columns: minmax(140px, 2.2fr) 58px 68px 78px 46px 52px;
    align-items: center;
    column-gap: 10px;
    width: 100%;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    border-right: 1px solid #f0f0f0;
    box-sizing: border-box;
}

.number-item:nth-child(2n) {
    border-right: none;
}

.number-display {
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 1px;
    min-width: 0;
}

.num-seg-prefix {
    color: #FF0063;
}

.num-seg-middle {
    color: #108FFF;
}

.num-seg-tail {
    color: #FF8800;
}

.landline-first {
    color: #c00000;
}

.landline-last {
    color: #0066cc;
}

.number-meta {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    text-align: left;
}

.number-price {
    font-size: 16px;
    color: #c00000;
    font-weight: bold;
    text-align: center;
    white-space: nowrap;
}

.number-location {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    text-align: center;
}

.number-carrier {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    text-align: center;
}

.number-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.empty-tip {
    padding: 60px 20px;
    text-align: center;
    color: #999;
    background: #fff;
    border: 1px solid #e5e5e5;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 20px 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    text-decoration: none;
}

.pagination a:hover,
.pagination span.current {
    background: #c00000;
    color: #fff;
    border-color: #c00000;
}

/* Detail page */
.detail-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    padding: 30px;
    flex: 1;
    min-width: 0;
}

.detail-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.detail-reserve-form {
    background: #fff;
    border: 1px solid #e5e5e5;
    padding: 24px;
    width: 360px;
    flex-shrink: 0;
}

.detail-reserve-form h3 {
    color: #c00000;
    font-size: 18px;
    margin-bottom: 8px;
}

.detail-reserve-tip {
    color: #666;
    font-size: 13px;
    margin-bottom: 16px;
}

.input-readonly {
    background: #f5f5f5;
    color: #666;
}

@media (max-width: 900px) {
    .detail-layout {
        flex-direction: column;
    }

    .detail-reserve-form {
        width: 100%;
    }
}

.detail-number {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 20px;
    letter-spacing: 2px;
}

.detail-info {
    margin-bottom: 20px;
}

.detail-info dt {
    display: inline-block;
    width: 100px;
    color: #666;
    margin-bottom: 8px;
}

.detail-info dd {
    display: inline-block;
    margin-bottom: 8px;
    color: #333;
}

.detail-actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
}

.detail-actions .btn-primary {
    padding: 12px 30px;
    font-size: 16px;
}

.detail-consult-btn {
    cursor: default;
    display: inline-block;
}

/* Form pages */
.form-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    padding: 30px;
    max-width: 700px;
    margin: 0 auto;
}

.form-card h2 {
    margin-bottom: 20px;
    color: #c00000;
    font-size: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #666;
    font-weight: bold;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

.form-actions {
    margin-top: 20px;
}

/* Static page */
.static-page {
    background: #fff;
    border: 1px solid #e5e5e5;
    padding: 30px;
    line-height: 1.8;
}

.static-page h2 {
    color: #c00000;
    margin-bottom: 20px;
}

.static-page p {
    margin-bottom: 12px;
}

.static-page-content p {
    margin-bottom: 12px;
}

.static-page-content a {
    color: #c00000;
}

.page-edit-tabs {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.page-edit-tabs .btn {
    text-decoration: none;
}

.page-edit-tabs .btn-primary {
    color: #fff;
}

.note-editor {
    margin-bottom: 15px;
}

/* Flash messages */
.flash {
    padding: 12px 15px;
    margin-bottom: 15px;
    border-radius: 3px;
}

.flash-success {
    background: #dff0d8;
    color: #3c763d;
    border: 1px solid #d6e9c6;
}

.flash-error {
    background: #f2dede;
    color: #a94442;
    border: 1px solid #ebccd1;
}

/* Admin */
.admin-body {
    background: #f0f2f5;
}

.admin-header {
    background: #001529;
    color: #fff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header a {
    color: #fff;
}

.admin-layout {
    display: flex;
    min-height: calc(100vh - 56px);
}

.admin-sidebar {
    width: 200px;
    background: #fff;
    border-right: 1px solid #e5e5e5;
    padding: 20px 0;
}

.admin-sidebar a {
    display: block;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
}

.admin-sidebar a:hover,
.admin-sidebar a.active {
    background: #fff1f0;
    color: #c00000;
}

.admin-main {
    flex: 1;
    padding: 20px;
}

.admin-card {
    background: #fff;
    padding: 20px;
    border: 1px solid #e5e5e5;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.admin-table th,
.admin-table td {
    border: 1px solid #e5e5e5;
    padding: 8px 10px;
    text-align: left;
    font-size: 13px;
}

.admin-table th {
    background: #fafafa;
}

.admin-login-box {
    max-width: 400px;
    margin: 100px auto;
    background: #fff;
    padding: 40px;
    border: 1px solid #e5e5e5;
}

.admin-login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #c00000;
}

.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

/* Admin modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: #fff;
    border-radius: 6px;
    width: 560px;
    max-width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e5e5;
}

.modal-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 0 4px;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-body .form-group {
    margin-bottom: 14px;
}

.modal-body .form-group label {
    display: block;
    margin-bottom: 5px;
    color: #666;
    font-size: 13px;
}

.modal-body .form-group input,
.modal-body .form-group select,
.modal-body .form-group textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
}

.modal-footer {
    padding: 12px 20px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* Footer */
.site-footer {
    background: #fff;
    border-top: 1px solid #e5e5e5;
    padding: 25px 0;
    margin-top: auto;
    text-align: center;
}

.site-footer .container {
    text-align: center;
}

.site-footer p {
    margin-bottom: 8px;
    color: #666;
    font-size: 13px;
}

.site-footer p:last-child {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .header-inner {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 8px 12px;
        align-items: center;
    }

    .brand .logo {
        font-size: 22px;
    }

    .city-info {
        display: none;
    }

    .header-search {
        grid-column: 1 / -1;
        min-width: 0;
    }

    .contact-info {
        text-align: right;
    }

    .contact-phone {
        font-size: 18px;
    }

    .contact-wechat {
        display: block;
    }

    .main-nav .container {
        padding: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-list {
        flex-wrap: nowrap;
        width: max-content;
        min-width: 100%;
    }

    .nav-list li a {
        padding: 10px 14px;
        font-size: 13px;
        white-space: nowrap;
    }

    .main-content {
        padding: 12px 0 30px;
    }

    .filter-row {
        flex-direction: column;
        padding: 10px 12px;
    }

    .filter-label {
        width: 100%;
        margin-bottom: 8px;
        padding-top: 0;
    }

    .filter-content {
        width: 100%;
    }

    .filter-input,
    .filter-select {
        width: 100%;
        min-width: 0;
    }

    .precise-inputs input {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }

    .sort-bar {
        padding: 10px 12px;
        gap: 8px;
    }

    .sort-bar .btn {
        flex: 1 1 calc(50% - 4px);
        text-align: center;
        min-width: 0;
        padding: 8px 6px;
        font-size: 13px;
    }

    .number-list {
        grid-template-columns: 1fr;
    }

    .number-item {
        border-right: none;
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        row-gap: 8px;
        padding: 12px;
    }

    .number-item:nth-child(2n) {
        border-right: none;
    }

    .number-display {
        font-size: 18px;
        letter-spacing: 0.5px;
    }

    .number-item-extra {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 8px 12px;
    }

    .number-meta,
    .number-price,
    .number-location,
    .number-carrier {
        font-size: 12px;
    }

    .number-price {
        font-size: 15px;
        font-weight: bold;
    }

    .number-actions {
        margin-left: auto;
    }

    .detail-card,
    .detail-reserve-form,
    .form-card,
    .static-page {
        padding: 20px 16px;
    }

    .detail-number {
        font-size: 26px;
        letter-spacing: 1px;
        word-break: break-all;
    }

    .detail-info dt {
        width: 80px;
        font-size: 13px;
    }

    .detail-info dd {
        font-size: 13px;
    }

    .detail-actions {
        flex-direction: column;
    }

    .detail-actions .btn,
    .detail-actions .btn-primary {
        width: 100%;
        text-align: center;
        padding: 12px 16px;
        font-size: 15px;
    }

    .form-actions .btn-primary {
        width: 100%;
        padding: 12px;
    }

    .pagination a,
    .pagination span {
        padding: 8px 12px;
        min-width: 36px;
        text-align: center;
    }

    .empty-tip {
        padding: 40px 16px;
        font-size: 13px;
    }
}

@media (min-width: 769px) {
    .number-item-extra {
        display: contents;
    }
}

@media (max-width: 992px) and (min-width: 769px) {
    .number-list {
        grid-template-columns: 1fr;
    }

    .number-item {
        border-right: none;
    }

    .number-item:nth-child(2n) {
        border-right: none;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    .brand .logo {
        font-size: 20px;
    }

    .contact-phone {
        font-size: 16px;
    }

    .number-display {
        font-size: 16px;
    }

    .filter-link {
        padding: 4px 8px;
        font-size: 13px;
    }

    .btn-sm {
        padding: 6px 12px;
    }
}
