/* ============================================
   远辰智联公告系统 - 后台管理样式
   配色: 蓝白为主 方形设计 政务感
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
    color: #1a1a1a;
    background: #f0f2f5;
    line-height: 1.6;
    font-size: 14px;
}

a {
    color: #0a5eb8;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #003d7a;
}

/* ---- 登录页 ---- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #003d7a 0%, #0a5eb8 55%, #2d8cf0 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 400px;
    height: 400px;
    background: rgba(255,255,255,0.03);
    border-radius: 50%;
}

.login-page::after {
    content: '';
    position: absolute;
    bottom: -150px;
    left: 5%;
    width: 600px;
    height: 600px;
    background: rgba(255,255,255,0.02);
    border-radius: 50%;
}

.login-box {
    background: #fff;
    width: 420px;
    padding: 48px 40px;
    position: relative;
    z-index: 2;
    box-shadow: 0 8px 40px rgba(0,0,0,0.15);
}

.login-box .login-header {
    text-align: center;
    margin-bottom: 36px;
}

.login-box .login-logo {
    width: 56px;
    height: 56px;
    background: #0a5eb8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
}

.login-box .login-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.login-box .login-subtitle {
    font-size: 14px;
    color: #888;
}

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
    width: 100%;
    height: 42px;
    border: 1px solid #d9d9d9;
    padding: 0 14px;
    font-size: 14px;
    color: #1a1a1a;
    outline: none;
    transition: border-color 0.2s;
    background: #fff;
    font-family: inherit;
}

.form-group textarea {
    height: 160px;
    padding: 10px 14px;
    resize: vertical;
    line-height: 1.7;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #0a5eb8;
}

.form-group select {
    appearance: none;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none'/%3E%3C/svg%3E") no-repeat right 14px center;
    padding-right: 36px;
}

.btn-primary {
    display: inline-block;
    height: 42px;
    line-height: 42px;
    padding: 0 28px;
    background: #0a5eb8;
    color: #fff;
    border: none;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.btn-primary:hover {
    background: #004d99;
}

.btn-danger {
    display: inline-block;
    height: 36px;
    line-height: 36px;
    padding: 0 18px;
    background: #d93025;
    color: #fff;
    border: none;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
    font-family: inherit;
}

.btn-danger:hover {
    background: #b3261e;
}

.btn-default {
    display: inline-block;
    height: 36px;
    line-height: 36px;
    padding: 0 18px;
    background: #fff;
    color: #333;
    border: 1px solid #d9d9d9;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    font-family: inherit;
}

.btn-default:hover {
    border-color: #0a5eb8;
    color: #0a5eb8;
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

.login-error {
    background: #fef0e0;
    color: #c57316;
    padding: 10px 14px;
    font-size: 14px;
    margin-bottom: 18px;
    border-left: 3px solid #c57316;
}

/* ---- 后台布局 ---- */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar-nav {
    width: 240px;
    background: #001f3f;
    color: #fff;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
}

.sidebar-brand {
    padding: 22px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand .brand-icon {
    width: 38px;
    height: 38px;
    background: #0a5eb8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-brand .brand-info {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}

.sidebar-brand .brand-sub {
    font-size: 12px;
    color: rgba(255,255,255,0.45);
    font-weight: 400;
}

.sidebar-menu {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.sidebar-menu .menu-label {
    padding: 16px 20px 6px;
    font-size: 12px;
    color: rgba(255,255,255,0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 20px;
    color: rgba(255,255,255,0.65);
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-menu a:hover {
    background: rgba(255,255,255,0.04);
    color: #fff;
}

.sidebar-menu a.active {
    background: rgba(10,94,184,0.2);
    color: #fff;
    border-left-color: #2d8cf0;
}

.sidebar-menu a .menu-icon {
    width: 20px;
    text-align: center;
    font-size: 15px;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 12px;
    color: rgba(255,255,255,0.25);
    text-align: center;
}

.main-area {
    flex: 1;
    margin-left: 240px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-header {
    height: 56px;
    background: #fff;
    border-bottom: 1px solid #e4e7ed;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 40;
}

.top-header .breadcrumb {
    font-size: 14px;
    color: #888;
}

.top-header .breadcrumb span {
    color: #1a1a1a;
    font-weight: 500;
}

.top-header .user-info {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: #555;
}

.top-header .user-info a {
    color: #888;
    font-size: 13px;
}

.top-header .user-info a:hover {
    color: #d93025;
}

.content-area {
    flex: 1;
    padding: 28px;
}

/* ---- 控制台 ---- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: #fff;
    border: 1px solid #e4e7ed;
    padding: 22px 24px;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    background: rgba(10,94,184,0.04);
}

.stat-card .stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #0a5eb8;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 14px;
    color: #888;
}

.stat-card.warn .stat-number {
    color: #c57316;
}

.stat-card.success .stat-number {
    color: #1a7f37;
}

.stat-card.info .stat-number {
    color: #003d7a;
}

/* ---- 面板 ---- */
.panel {
    background: #fff;
    border: 1px solid #e4e7ed;
    margin-bottom: 24px;
}

.panel-head {
    padding: 16px 22px;
    border-bottom: 1px solid #e4e7ed;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fafbfc;
}

.panel-head h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
}

.panel-body {
    padding: 20px 22px;
}

/* ---- 表格 ---- */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    background: #fafbfc;
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    border-bottom: 1px solid #e4e7ed;
    white-space: nowrap;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f2f5;
    font-size: 14px;
    color: #333;
    vertical-align: middle;
}

.data-table tr:hover {
    background: #f7f9fc;
}

.data-table .status-tag {
display: inline-block;
padding: 0 10px;
font-size: 12px;
font-weight: 500;
line-height: 22px;
white-space: nowrap;
vertical-align: middle;
}

.data-table .status-tag.published {
    background: #e6f7ef;
    color: #1a7f37;
}

.data-table .status-tag.draft {
    background: #f0f2f5;
    color: #888;
}

.data-table .status-tag.enabled {
    background: #e6f7ef;
    color: #1a7f37;
}

.data-table .status-tag.disabled {
    background: #fef0e0;
    color: #c57316;
}

.action-btns {
    display: flex;
    gap: 8px;
}

.action-btns a,
.action-btns button {
    font-size: 13px;
    color: #0a5eb8;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
    transition: color 0.2s;
}

.action-btns a:hover,
.action-btns button:hover {
    color: #003d7a;
}

.action-btns .btn-del {
    color: #d93025;
}

.action-btns .btn-del:hover {
    color: #b3261e;
}

/* ---- API管理 ---- */
.api-item {
    border: 1px solid #e4e7ed;
    padding: 20px 24px;
    margin-bottom: 16px;
    background: #fff;
}

.api-item .api-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.api-item .api-name {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.api-field {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.api-field .api-label {
    width: 80px;
    font-size: 13px;
    color: #888;
    font-weight: 500;
    flex-shrink: 0;
}

.api-field .api-value {
    flex: 1;
    background: #fafbfc;
    border: 1px solid #e4e7ed;
    padding: 8px 12px;
    font-size: 13px;
    color: #333;
    font-family: "Consolas", "Monaco", monospace;
    word-break: break-all;
}

.api-field .api-copy {
    height: 36px;
    padding: 0 14px;
    background: #0a5eb8;
    color: #fff;
    border: none;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
    flex-shrink: 0;
}

.api-field .api-copy:hover {
    background: #004d99;
}

/* ---- 表单页面 ---- */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* ---- 后台底部 ---- */
.admin-footer {
    padding: 18px 28px;
    text-align: center;
    font-size: 13px;
    color: #aaa;
    border-top: 1px solid #e4e7ed;
    background: #fff;
}

.admin-footer a {
    color: #aaa;
}

.admin-footer a:hover {
    color: #0a5eb8;
}

/* ---- 空状态 ---- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #bbb;
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    color: #d9d9d9;
}

.empty-state p {
    font-size: 15px;
}

/* ---- 模态框 ---- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.45);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-box {
    background: #fff;
    width: 440px;
    padding: 32px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.modal-box h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #1a1a1a;
}

.modal-box p {
    font-size: 15px;
    color: #555;
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ---- 提示消息 ---- */
.alert-success {
    background: #e6f7ef;
    border-left: 3px solid #1a7f37;
    color: #1a7f37;
    padding: 12px 16px;
    margin-bottom: 18px;
    font-size: 14px;
}

.alert-error {
    background: #fce8e6;
    border-left: 3px solid #d93025;
    color: #d93025;
    padding: 12px 16px;
    margin-bottom: 18px;
    font-size: 14px;
}

/* ---- Toast ---- */
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    background: #1a1a1a;
    color: #fff;
    padding: 14px 24px;
    font-size: 14px;
    z-index: 9999;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s, transform 0.3s;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ---- 响应式 ---- */
@media (max-width: 900px) {
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .sidebar-nav {
        width: 200px;
    }
    .main-area {
        margin-left: 200px;
    }
}

@media (max-width: 768px) {
    .sidebar-nav {
        width: 100%;
        position: relative;
        bottom: auto;
        height: auto;
    }

    .admin-layout {
        flex-direction: column;
    }

    .main-area {
        margin-left: 0;
    }

    .sidebar-menu {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0;
    }

    .sidebar-menu .menu-label {
        display: none;
    }

    .sidebar-menu a {
        padding: 12px 16px;
        border-left: none;
        border-bottom: 2px solid transparent;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .sidebar-menu a.active {
        border-left: none;
        border-bottom-color: #2d8cf0;
    }

    .sidebar-footer {
        display: none;
    }

    .top-header {
        padding: 0 16px;
        height: 48px;
    }

    .top-header .breadcrumb {
        font-size: 12px;
    }

    .top-header .user-info {
        gap: 8px;
        font-size: 12px;
    }

    .content-area {
        padding: 16px;
    }

    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-card {
        padding: 16px;
    }

    .stat-card .stat-number {
        font-size: 24px;
    }

    .panel-head {
        padding: 12px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .panel-body {
        padding: 14px 16px;
    }

    .data-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table th,
    .data-table td {
        padding: 10px 12px;
        font-size: 13px;
    }

    .action-btns {
        flex-wrap: wrap;
        gap: 6px;
    }

    .api-item {
        padding: 14px 16px;
    }

    .api-field {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }

    .api-field .api-label {
        width: auto;
    }

    .api-field .api-copy {
        width: 100%;
        text-align: center;
    }

    .login-box {
        width: 100%;
        max-width: 400px;
        margin: 16px;
        padding: 32px 24px;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn-primary,
    .form-actions .btn-default {
        width: 100%;
        text-align: center;
    }

    .admin-footer {
        padding: 14px 16px;
        font-size: 11px;
        line-height: 1.6;
    }
}

@media (max-width: 480px) {
    .stat-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-card .stat-number {
        font-size: 20px;
    }

    .stat-card .stat-label {
        font-size: 12px;
    }

    .login-box {
        padding: 24px 20px;
    }

    .login-box .login-title {
        font-size: 18px;
    }

    .top-header .user-info span {
        display: none;
    }
}
