@charset "utf-8";

/* Reset & Basic Styles */
blockquote,
body,
button,
dd,
dl,
dt,
fieldset,
form,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
img,
input,
legend,
li,
ol,
p,
pre,
td,
textarea,
th,
ul {
    margin: 0;
    padding: 0;
    border: medium none
}

body,
button,
input,
select,
textarea {
    font: 13px 'Microsoft YaHei', '微软雅黑', sans-serif;
    color: #333;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

em {
    font-style: normal
}

li,
ol,
ul {
    list-style: none
}

a {
    text-decoration: none;
    color: #333;
}

a:hover {
    color: #a60514;
    text-decoration: underline
}

/* Utilities */
.clearfix::after {
    content: "";
    display: block;
    clear: both;
}

/* Header */
#header {
    max-width: 1200px;
    width: 100%;
    min-height: 60px;
    font-size: 14px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
}

.logo {
    color: #a60514;
    text-decoration: underline;
    font-weight: 700;
    font-style: italic;
    font-size: 36px;
    line-height: 60px;
}

.top {
    text-align: center;
    font-size: 14px;
    line-height: 60px;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

#time {
    color: #990000;
    font-weight: bold;
    font-size: 20px;
}

#nav-panel-title-weather {
    display: none;
}

/* Hidden as per original but just in case */

/* Search Bar */
/* Search Bar - Minimalist Rectangular */
#search-bar {
    margin: 30px auto;
    max-width: 680px;
    width: 90%;
    height: 48px;
    display: flex;
    background: #fff;
    border: 2px solid #a60514;
    /* Theme Color Border */
    border-radius: 0;
    /* Rectangular */
    box-shadow: none;
    transition: all 0.3s ease;
}

#search-bar:hover,
#search-bar:focus-within {
    border-color: #a60514;
    transform: none;
    box-shadow: none;
}

#search-bar input {
    flex: 1;
    height: 100%;
    padding: 0 15px;
    font-size: 16px;
    color: #444;
    border: none;
    outline: none;
    background: transparent;
    font-weight: normal;
}

#search-bar input::placeholder {
    color: #ccc;
}

#search-bar button {
    width: 100px;
    height: 100%;
    font-size: 16px;
    font-weight: normal;
    color: #fff;
    border: none;
    background: #a60514;
    /* Theme Color */
    outline: none;
    cursor: pointer;
    transition: background-color 0.2s;
    letter-spacing: 2px;
    border-radius: 0;
}

#search-bar button:hover {
    background: #8e0411;
    /* Darker shade */
    box-shadow: none;
}

/* Nav Panel */
#nav-panel {
    margin: 5px auto 20px;
    max-width: 1164px;
    width: 98%;
    padding: 10px 20px 30px;
    background-color: #FFFFFF;
    border: 1px solid rgb(210, 210, 210);
    min-height: 500px;
}

.category-section {
    margin-bottom: 0px;
    clear: both;
}

.category-header {
    width: 100%;
    border-bottom: 1px solid #a60514;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    padding-bottom: 5px;
}

.category-title {
    color: #a60514;
    font-weight: bold;
    font-size: 14px;
    margin-right: 20px;
    min-width: 80px;
}

.category-hot {
    font-size: 12px;
    color: #CC0000;
    display: flex;
    align-items: center;
    overflow-x: auto;
}

.category-hot ul {
    display: flex;
    white-space: nowrap;
}

.category-hot li {
    margin: 0 5px;
}

.links-container {
    overflow: hidden;
    padding-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
}

.nav-item-wrapper {
    float: left;
    position: relative;
    /* Updated to match recent changes */
    margin-right: 10px;
    margin-bottom: 5px;
    width: 160px;
    max-width: 50%;
    padding-right: 10px;
}

.nav-item {
    display: block;
    height: 40px;
    width: 100%;
    border: 1px solid transparent;
    text-decoration: none;
    color: #333;
    line-height: 40px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-left: 5px;
}

.nav-item:hover {
    background-color: #F7F7F7;
    border: 1px solid #eee;
}

.nav-item.hot {
    color: #FF0000;
}

.nav-panel-line {
    clear: both;
    width: 100%;
    height: 1px;
    background-color: #F0F0F0;
    margin: 10px 0;
}

/* Admin / Login */
.login-container {
    width: 100%;
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
    border: 1px solid #ddd;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    height: 35px;
    padding: 5px;
    border: 1px solid #ccc;
}

.btn {
    display: inline-block;
    padding: 8px 16px;
    background: #008cd6;
    color: #fff;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: #0074b2;
    text-decoration: none;
}

.admin-header {
    background: #333;
    color: #fff;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.admin-header a {
    color: #fff;
    margin-left: 20px;
}

.admin-container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.admin-section {
    margin-bottom: 40px;
    border: 1px solid #eee;
    padding: 20px;
    background: #fff;
}

.admin-section h2 {
    margin-bottom: 20px;
    border-bottom: 2px solid #008cd6;
    padding-bottom: 10px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

th {
    background-color: #f2f2f2;
}

.actions a {
    margin-right: 10px;
    font-size: 12px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #2196F3;
}

input:focus+.slider {
    box-shadow: 0 0 1px #2196F3;
}

input:checked+.slider:before {
    -webkit-transform: translateX(20px);
    -ms-transform: translateX(20px);
    transform: translateX(20px);
}

/* Footer */
#footer {
    margin: 0 auto;
    width: 100%;
    height: 30px;
    color: #999;
    text-align: center;
    font-size: 14px;
    line-height: 30px
}

/* Mobile Responsiveness */
@media screen and (max-width: 768px) {
    #header {
        flex-direction: column;
        height: auto;
        padding: 10px;
    }

    .logo,
    .top {
        float: none;
        width: 100%;
        text-align: center;
        margin: 0;
        line-height: 40px;
    }

    #search-bar {
        width: 90%;
    }

    #nav-panel {
        padding: 10px;
    }

    .category-header {
        display: block;
        height: auto;
    }

    .category-title {
        margin-bottom: 5px;
        display: block;
    }

    .category-hot {
        margin-top: 5px;
        overflow-x: auto;
        padding-bottom: 5px;
    }

    .nav-item-wrapper {
        width: 33.33%;
        /* 3 items per row on tablet/large phone */
    }

    /* Responsive Table for Admin on Mobile */
    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    tr {
        border: 1px solid #ccc;
        margin-bottom: 10px;
    }

    td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding-left: 50% !important;
    }

    td:before {
        position: absolute;
        top: 6px;
        left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
        content: attr(data-label);
    }
}

@media screen and (max-width: 480px) {
    .nav-item-wrapper {
        width: 50%;
        /* 2 items per row on small phones */
    }

    .top {
        font-size: 12px;
    }

    #time {
        font-size: 16px;
    }

    .modal-content {
        width: 90%;
        margin: 20% auto;
    }
}

/* =========================================
   Consolidated Styles from Page Code
   ========================================= */

/* --- Modal Styles (Admin & Front) --- */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 500px;
    max-width: 90%;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}

/* --- Admin Specific Buttons & Elements --- */
.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

.btn-danger {
    background-color: #dc3545;
}

.btn-danger:hover {
    background-color: #c82333;
}

.item-row:hover {
    background-color: #f9f9f9;
}

.hidden-badge {
    background: #eee;
    color: #666;
    padding: 2px 5px;
    font-size: 10px;
    border-radius: 3px;
}

/* --- Batch Operation Buttons --- */
.btn-batch {
    background-color: #6c757d;
    color: white;
    padding: 4px 8px;
    font-size: 12px;
}

.btn-batch:hover {
    background-color: #5a6268;
}

.btn-check {
    background-color: #fd7e14;
    color: white;
    padding: 4px 8px;
    font-size: 12px;
}

.btn-check:hover {
    background-color: #e36d0d;
}

.btn-batch-delete {
    background-color: #dc3545;
    color: white;
    padding: 4px 8px;
    font-size: 12px;
}

.btn-batch-delete:hover {
    background-color: #bd2130;
}

/* --- Color Swatch --- */
.color-swatch {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 5px;
    cursor: pointer;
    border: 1px solid #ccc;
    vertical-align: middle;
}

/* --- Front-end Admin Controls --- */
.admin-controls {
    position: absolute;
    top: 50%;
    right: 5px;
    transform: translateY(-50%);
    display: none;
    background: rgba(255, 255, 255, 0.95);
    padding: 2px 5px;
    border-radius: 4px;
    box-shadow: -2px 0 5px rgba(255, 255, 255, 1);
}

.nav-item-wrapper:hover .admin-controls {
    display: flex;
    align-items: center;
}

.action-btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 22px;
    height: 22px;
    margin-left: 5px;
    border-radius: 4px;
    text-decoration: none !important;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    border: none;
    outline: none;
}

.edit-btn {
    background-color: #e3f2fd;
    color: #1976d2 !important;
}

.edit-btn:hover {
    background-color: #2196f3;
    color: #fff !important;
}

.del-btn {
    background-color: #ffebee;
    color: #c62828 !important;
}

.del-btn:hover {
    background-color: #f44336;
    color: #fff !important;
}

/* --- Add Link Button (Front-End) --- */
.add-link-btn {
    float: left;
    margin: 10px;
    cursor: pointer;
    background: #fff;
    border: 1px dashed #ccc;
    padding: 5px 15px;
    color: #666;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.2s;
    order: 9999;
    /* Maintain position */
}

.add-link-btn:hover {
    border-color: #a60514;
    color: #a60514;
    background: #fff;
}