* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #F5F7FA;
    color: #1A1A1A;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

.login-body {
    background: linear-gradient(135deg, #07C160 0%, #00D26A 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: 20px;
    padding: 40px 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo .logo-icon {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
}

.login-logo h1 {
    font-size: 22px;
    color: #1A1A1A;
    margin-bottom: 6px;
}

.login-logo p {
    font-size: 14px;
    color: #999;
}

.error-msg {
    background: #FFF0F0;
    color: #FF4D4F;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .form-group label {
    display: block;
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    font-weight: 500;
}

.login-form .form-group input {
    width: 100%;
    height: 46px;
    padding: 0 16px;
    border: 1px solid #E5E5E5;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.2s;
}

.login-form .form-group input:focus {
    outline: none;
    border-color: #07C160;
    box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.1);
}

.btn-login {
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, #07C160, #00D26A);
    color: #fff;
    border: none;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(7, 193, 96, 0.3);
}

.login-footer {
    text-align: center;
    margin-top: 20px;
}

.login-footer a {
    color: #999;
    text-decoration: none;
    font-size: 13px;
}

.login-footer a:hover {
    color: #07C160;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 240px;
    background: #fff;
    border-right: 1px solid #EEE;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.sidebar-logo {
    padding: 24px 20px;
    border-bottom: 1px solid #F0F0F0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo .logo-icon {
    font-size: 28px;
}

.sidebar-logo .logo-text {
    font-size: 17px;
    font-weight: 700;
    color: #1A1A1A;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #666;
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 4px;
    transition: all 0.2s;
    font-size: 14px;
}

.nav-item:hover {
    background: #F5F7FA;
    color: #333;
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(7, 193, 96, 0.1), rgba(0, 210, 106, 0.1));
    color: #07C160;
    font-weight: 500;
}

.nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid #F0F0F0;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: #999;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.2s;
    font-size: 14px;
}

.logout-btn:hover {
    background: #FFF0F0;
    color: #FF4D4F;
}

.admin-main {
    margin-left: 240px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.admin-header {
    background: #fff;
    border-bottom: 1px solid #EEE;
    padding: 16px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.admin-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1A1A1A;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-user {
    color: #666;
    font-size: 14px;
}

.btn-outline-sm {
    padding: 8px 16px;
    border: 1px solid #07C160;
    color: #07C160;
    background: #fff;
    border-radius: 20px;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s;
}

.btn-outline-sm:hover {
    background: #F0FFF4;
}

.admin-content {
    padding: 24px 32px;
    flex: 1;
}

.alert {
    padding: 14px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert.success {
    background: #F0FFF4;
    color: #07C160;
    border: 1px solid #B7EB8F;
}

.alert.error {
    background: #FFF0F0;
    color: #FF4D4F;
    border: 1px solid #FFCCC7;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}

.stat-icon.green {
    background: #F0FFF4;
}

.stat-icon.blue {
    background: #E6F4FF;
}

.stat-icon.purple {
    background: #F9F0FF;
}

.stat-icon.orange {
    background: #FFF3E8;
}

.stat-info {
    flex: 1;
    min-width: 0;
}

.stat-label {
    font-size: 13px;
    color: #999;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #1A1A1A;
}

.stat-value.small {
    font-size: 16px;
}

.stat-value.green {
    color: #07C160;
}

.stat-value.orange {
    color: #FF9500;
}

.stat-value.red {
    color: #FF4D4F;
}

.panel-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.panel {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    margin-bottom: 24px;
}

.panel-header {
    padding: 20px 24px;
    border-bottom: 1px solid #F0F0F0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1A1A1A;
}

.btn-link {
    color: #07C160;
    text-decoration: none;
    font-size: 14px;
}

.btn-link:hover {
    text-decoration: underline;
}

.panel-body {
    padding: 24px;
}

.qr-preview-wrapper {
    width: 200px;
    height: 200px;
    margin: 0 auto 16px;
    border-radius: 12px;
    border: 2px solid #E8FBF0;
    overflow: hidden;
    background: #FAFAFA;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.qr-placeholder-sm {
    color: #BBB;
    font-size: 14px;
    text-align: center;
}

.qr-info {
    text-align: center;
}

.qr-name {
    font-size: 16px;
    font-weight: 600;
    color: #1A1A1A;
    margin-bottom: 4px;
}

.qr-desc {
    font-size: 13px;
    color: #999;
}

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid #F0F0F0;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.action-card:hover {
    border-color: #07C160;
    background: #F0FFF4;
    transform: translateX(4px);
}

.action-icon {
    width: 44px;
    height: 44px;
    background: #F5F7FA;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.action-text {
    flex: 1;
}

.action-title {
    font-size: 15px;
    font-weight: 600;
    color: #1A1A1A;
    margin-bottom: 2px;
}

.action-desc {
    font-size: 13px;
    color: #999;
}

.content-preview {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.preview-item {
    display: flex;
    gap: 16px;
    padding: 12px 16px;
    background: #F9FAFB;
    border-radius: 8px;
}

.preview-label {
    color: #999;
    font-size: 14px;
    min-width: 80px;
    flex-shrink: 0;
}

.preview-value {
    color: #333;
    font-size: 14px;
    flex: 1;
}

.form-horizontal .form-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 24px;
}

.form-label {
    width: 120px;
    flex-shrink: 0;
    padding-top: 12px;
    font-size: 14px;
    color: #333;
    font-weight: 500;
    text-align: right;
    padding-right: 20px;
}

.form-control {
    flex: 1;
}

.form-control input[type="text"],
.form-control input[type="number"],
.form-control input[type="email"],
.form-control input[type="password"],
.form-control input[type="url"],
.form-control textarea {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    background: #fff;
}

.form-control input:focus,
.form-control textarea:focus {
    outline: none;
    border-color: #07C160;
    box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.1);
}

.form-control input[type="url"] {
    font-family: 'SF Mono', Consolas, 'Liberation Mono', monospace;
    font-size: 13px;
    background: #FAFBFC;
}

.form-control input[type="url"]::placeholder {
    color: #BBB;
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 13px;
}

.form-control textarea {
    height: 100px;
    padding: 12px 14px;
    resize: vertical;
}

/* 文件上传美化（多文件 / 轮换子项等场景） */
.form-control .file-upload {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-control .file-upload-area {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border: 2px dashed #D9D9D9;
    border-radius: 10px;
    background: #FAFAFA;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
    min-height: 64px;
}

.form-control .file-upload-area:hover {
    border-color: #07C160;
    background: #F0FFF4;
}

.form-control .file-upload-area.dragover {
    border-color: #07C160;
    background: #F0FFF4;
    border-style: solid;
}

.form-control .file-upload-area .file-upload-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 8px;
    background: #E8FBF0;
    color: #07C160;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.form-control .file-upload-area .file-upload-text {
    flex: 1;
    min-width: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.form-control .file-upload-area .file-upload-text strong {
    color: #07C160;
    font-weight: 600;
}

.form-control .file-upload-area .file-upload-text small {
    display: block;
    color: #999;
    font-size: 12px;
    margin-top: 2px;
}

.form-control .file-upload-area .file-upload-browse {
    flex-shrink: 0;
    padding: 6px 16px;
    border: 1px solid #07C160;
    color: #07C160;
    background: #fff;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.form-control .file-upload-area:hover .file-upload-browse {
    background: #07C160;
    color: #fff;
}

.form-control .file-upload input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.form-control .file-upload-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.form-control .file-upload-list .file-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #E8FBF0;
    color: #07C160;
    border: 1px solid #B7EB8F;
    border-radius: 16px;
    font-size: 12px;
    max-width: 240px;
}

.form-control .file-upload-list .file-chip .file-chip-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.form-control .file-upload-list .file-chip .file-chip-remove {
    cursor: pointer;
    color: #999;
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
}

.form-control .file-upload-list .file-chip .file-chip-remove:hover {
    color: #FF4D4F;
}

/* URL 输入框（带前缀图标和清空按钮） */
.form-control .url-input-wrap {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 100%;
    height: 44px;
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    background: #FAFBFC;
    transition: all 0.2s;
    overflow: hidden;
}

.form-control .url-input-wrap:hover {
    border-color: #B7EB8F;
    background: #fff;
}

.form-control .url-input-wrap:focus-within {
    border-color: #07C160;
    box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.1);
    background: #fff;
}

.form-control .url-input-wrap .url-prefix {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: #F0F7F3;
    color: #07C160;
    font-size: 16px;
    border-right: 1px solid #E5E5E5;
}

.form-control .url-input-wrap input[type="url"] {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    font-family: 'SF Mono', Consolas, 'Liberation Mono', monospace;
    font-size: 13px;
    padding: 0 12px;
    outline: none;
    border-radius: 0;
}

.form-control .url-input-wrap input[type="url"]:focus {
    box-shadow: none !important;
}

.form-control .url-input-wrap input[type="url"]::placeholder {
    color: #BBB;
    font-family: 'SF Mono', Consolas, 'Liberation Mono', monospace;
    font-size: 13px;
}

.form-control .url-input-wrap .url-clear {
    flex-shrink: 0;
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    border: none;
    background: transparent;
    color: #999;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.2s;
}

.form-control .url-input-wrap .url-clear:hover {
    color: #FF4D4F;
}

.form-control .url-input-wrap.has-value .url-clear {
    display: flex;
}

.form-tip {
    margin-top: 8px;
    font-size: 12px;
    color: #999;
}

.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.toggle-switch input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: relative;
    width: 48px;
    height: 26px;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #07C160;
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(22px);
}

.btn-primary {
    padding: 0 32px;
    height: 44px;
    background: linear-gradient(135deg, #07C160, #00D26A);
    color: #fff;
    border: none;
    border-radius: 22px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(7, 193, 96, 0.3);
}

.upload-area {
    position: relative;
    border: 2px dashed #D9D9D9;
    border-radius: 12px;
    background: #FAFAFA;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
    width: 100%;
    max-width: 280px;
    height: 280px;
    box-sizing: border-box;
}

.upload-area:hover {
    border-color: #07C160;
    background: #F0FFF4;
}

.upload-area.dragover {
    border-color: #07C160;
    background: #F0FFF4;
}

.file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.upload-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.upload-text {
    font-size: 15px;
    color: #666;
    margin-bottom: 6px;
}

.upload-tip {
    font-size: 12px;
    color: #BBB;
}

.upload-preview {
    width: 100%;
    height: 100%;
    position: relative;
}

.upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.preview-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.2s;
}

.upload-area:hover .preview-mask {
    opacity: 1;
}

.benefits-list-editor {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

/* Logo 类型切换 Tab（系统设置、二维码自定义品牌共享） */
.logo-type-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}
.logo-type-tab {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: #666;
    user-select: none;
}
.logo-type-tab:hover {
    border-color: #07C160;
    color: #07C160;
}
.logo-type-tab.active {
    border-color: #07C160;
    background: #F0FFF4;
    color: #07C160;
    font-weight: 500;
}
@media (max-width: 768px) {
    .logo-type-tabs {
        gap: 8px;
    }
    .logo-type-tab {
        padding: 8px 6px;
        font-size: 13px;
    }
}

.benefit-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.benefit-sort {
    color: #CCC;
    cursor: grab;
    font-size: 16px;
    user-select: none;
}

.benefit-input-row input {
    flex: 1;
    height: 42px;
    padding: 0 14px;
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.benefit-input-row input:focus {
    outline: none;
    border-color: #07C160;
    box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.1);
}

.btn-delete-benefit {
    width: 36px;
    height: 36px;
    border: none;
    background: #FFF0F0;
    color: #FF4D4F;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-delete-benefit:hover {
    background: #FF4D4F;
    color: #fff;
}

.btn-add-benefit {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: #F5F7FA;
    border: 1px dashed #D9D9D9;
    border-radius: 8px;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-benefit:hover {
    border-color: #07C160;
    color: #07C160;
    background: #F0FFF4;
}

.btn-add-benefit span {
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin-bottom: 8px;
    border-radius: 10px;
    background: #F5F7FA;
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #07C160, #00D26A);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: #1A1A1A;
    margin-bottom: 2px;
}

.user-role {
    font-size: 12px;
    color: #999;
}

.btn-primary-sm {
    padding: 8px 18px;
    background: linear-gradient(135deg, #07C160, #00D26A);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-block;
    text-align: center;
}

.btn-primary-sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(7, 193, 96, 0.3);
}

.btn-outline-sm {
    padding: 8px 18px;
    background: #fff;
    color: #07C160;
    border: 1px solid #07C160;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-block;
    text-align: center;
}

.btn-outline-sm:hover {
    background: #F0FFF4;
}

.btn-outline {
    padding: 0 28px;
    height: 44px;
    background: #fff;
    color: #666;
    border: 1px solid #E5E5E5;
    border-radius: 22px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    margin-left: 12px;
}

.btn-outline:hover {
    border-color: #07C160;
    color: #07C160;
}

.table-wrapper {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    text-align: left;
    padding: 14px 16px;
    background: #F9FAFB;
    color: #666;
    font-weight: 500;
    border-bottom: 1px solid #F0F0F0;
    white-space: nowrap;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #F5F5F5;
    color: #333;
}

.data-table tr:hover td {
    background: #FAFAFA;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-primary {
    background: #E6F4FF;
    color: #1677FF;
}

.badge-success {
    background: #F0FFF4;
    color: #07C160;
}

.badge-danger {
    background: #FFF0F0;
    color: #FF4D4F;
}

.badge-default {
    background: #F0F0F0;
    color: #666;
}

.badge-warning {
    background: #FFF7E6;
    color: #FF8C00;
}

.action-btns {
    display: flex;
    gap: 12px;
    align-items: center;
}

.action-btns .btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1.4;
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    -webkit-appearance: none;
    appearance: none;
    height: auto;
    vertical-align: middle;
}

.btn-link.danger {
    color: #FF4D4F;
}

.btn-link.danger:hover {
    color: #D9363E;
}

.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 24px;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.page-btn:hover {
    border-color: #07C160;
    color: #07C160;
}

.page-btn.active {
    background: #07C160;
    border-color: #07C160;
    color: #fff;
}

.form-select {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.form-select:focus {
    outline: none;
    border-color: #07C160;
    box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.1);
}

.qr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.qr-card {
    background: #fff;
    border: 1px solid #F0F0F0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
}

.qr-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.qr-card-thumb {
    position: relative;
    aspect-ratio: 1;
    background: #FAFAFA;
    overflow: hidden;
}

.qr-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.no-qr-img {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #BBB;
    gap: 8px;
}

.no-qr-img span {
    font-size: 36px;
}

.no-qr-img p {
    font-size: 13px;
}

.qr-card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.qr-card-badge.success {
    background: rgba(7, 193, 96, 0.9);
    color: #fff;
}

.qr-card-badge.warning {
    background: rgba(255, 149, 0, 0.9);
    color: #fff;
}

.qr-card-badge.danger {
    background: rgba(255, 77, 79, 0.9);
    color: #fff;
}

.qr-card-body {
    padding: 14px 16px;
}

.qr-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #1A1A1A;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qr-card-subtitle {
    font-size: 13px;
    color: #999;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.qr-card-meta {
    font-size: 12px;
    color: #BBB;
    margin-bottom: 2px;
}

.qr-card-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #F5F5F5;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.qr-card-actions-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.qr-card-actions-row.primary {
    justify-content: space-between;
}

.qr-card-actions-row.secondary {
    justify-content: center;
    padding-top: 6px;
    border-top: 1px dashed #F0F0F0;
    gap: 4px;
}

.qr-card-actions .btn-link {
    flex: 1;
    text-align: center;
    padding: 7px 8px;
    border-radius: 6px;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s;
    color: #07C160;
    background: transparent;
    border: none;
    cursor: pointer;
    line-height: 1.4;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: auto;
    -webkit-appearance: none;
    appearance: none;
    white-space: nowrap;
}

.qr-card-actions-row.primary .btn-link {
    background: #F6FFFA;
    font-weight: 500;
}

.qr-card-actions-row.primary .btn-link:hover {
    background: #E8FBF0;
}

.qr-card-actions-row.primary .btn-link.danger {
    color: #FF4D4F;
    background: #FFF5F5;
}

.qr-card-actions-row.primary .btn-link.danger:hover {
    background: #FFE8E8;
}

.qr-card-actions-row.secondary .btn-link {
    flex: 1;
    padding: 5px 6px;
    font-size: 12px;
    color: #666;
    background: #F9FAFB;
    border-radius: 4px;
}

.qr-card-actions-row.secondary .btn-link:hover {
    color: #07C160;
    background: #F0FFF4;
}

.qr-card-actions-row.secondary .btn-link.icon-only {
    flex: 0 0 auto;
    min-width: auto;
    padding: 5px 10px;
    font-size: 14px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 20px;
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding: 14px 18px;
    background: #F9FAFB;
    border-radius: 10px;
    flex-wrap: wrap;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #fff;
    border: 1px solid #E5E5E5;
    border-radius: 20px;
    color: #333;
    font-size: 13px;
    font-weight: 500;
}

.filter-tag.active {
    background: linear-gradient(135deg, rgba(7, 193, 96, 0.1), rgba(0, 210, 106, 0.1));
    border-color: #B7EB8F;
    color: #07C160;
}

.filter-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.filter-tabs {
    display: flex;
    gap: 8px;
}

.filter-tab {
    padding: 6px 16px;
    background: #fff;
    border: 1px solid #E5E5E5;
    border-radius: 16px;
    font-size: 13px;
    color: #666;
    text-decoration: none;
    transition: all 0.2s;
}

.filter-tab:hover {
    border-color: #07C160;
    color: #07C160;
}

.filter-tab.active {
    background: #07C160;
    border-color: #07C160;
    color: #fff;
}

.filter-select-wrap {
    margin-left: auto;
}

.filter-select {
    padding: 6px 14px;
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    font-size: 13px;
    color: #333;
    background: #fff;
    cursor: pointer;
    min-width: 160px;
    transition: all 0.2s;
}

.filter-select:focus {
    outline: none;
    border-color: #07C160;
}

.quota-bar {
    margin-bottom: 24px;
    padding: 16px 20px;
    background: #F9FAFB;
    border-radius: 10px;
}

.quota-bar > span {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.quota-bar strong {
    color: #07C160;
    font-size: 18px;
}

.quota-progress {
    height: 8px;
    background: #E8E8E8;
    border-radius: 4px;
    overflow: hidden;
}

.quota-fill {
    height: 100%;
    background: linear-gradient(90deg, #07C160, #00D26A);
    border-radius: 4px;
    transition: width 0.3s;
}

.section-divider {
    text-align: center;
    margin: 32px 0 24px;
    position: relative;
}

.section-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #F0F0F0;
}

.section-divider span {
    position: relative;
    padding: 0 16px;
    background: #fff;
    color: #999;
    font-size: 14px;
    font-weight: 500;
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
    transition: background 0.2s;
}

.recent-item:hover {
    background: #F9FAFB;
}

.recent-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    background: #F5F5F5;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recent-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recent-thumb .no-img {
    font-size: 11px;
    color: #BBB;
}

.recent-info {
    flex: 1;
    min-width: 0;
}

.recent-name {
    font-size: 14px;
    font-weight: 500;
    color: #1A1A1A;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-meta {
    font-size: 12px;
    color: #999;
}

.recent-edit {
    flex-shrink: 0;
    color: #07C160;
    text-decoration: none;
    font-size: 13px;
}

.recent-edit:hover {
    text-decoration: underline;
}

.action-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-card.disabled:hover {
    border-color: #F0F0F0;
    background: #fff;
    transform: none;
}

.modal-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-box {
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    max-height: 90vh;
    overflow: hidden;
    animation: scaleIn 0.2s ease;
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #F0F0F0;
}

.modal-header h3 {
    font-size: 17px;
    font-weight: 600;
    color: #1A1A1A;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #F5F7FA;
    border-radius: 50%;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}

.modal-close:hover {
    background: #FF4D4F;
    color: #fff;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 24px 24px;
    justify-content: center;
}

.promo-qr-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.promo-qr-img {
    width: 240px;
    height: 240px;
    display: block;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.promo-info {
    text-align: center;
}

.promo-title {
    font-size: 18px;
    font-weight: 600;
    color: #1A1A1A;
    margin-bottom: 8px;
}

.promo-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}

.promo-url {
    font-size: 12px;
    color: #999;
    word-break: break-all;
    padding: 8px 12px;
    background: #F5F7FA;
    border-radius: 8px;
    line-height: 1.4;
}

/* 桌面端默认隐藏手机菜单按钮和遮罩 */
.mobile-menu-toggle {
    display: none;
}
.sidebar-overlay {
    display: none;
}

/* ===== 平板适配 (<= 900px) ===== */
@media (max-width: 900px) {
    .admin-sidebar {
        width: 60px;
    }
    .sidebar-logo .logo-text,
    .nav-item span:not(.nav-icon),
    .logout-btn span:not(:first-child),
    .user-info > div:not(.user-avatar) {
        display: none;
    }
    .sidebar-logo {
        justify-content: center;
        padding: 20px 0;
    }
    .nav-item {
        justify-content: center;
        padding: 12px;
    }
    .user-info {
        justify-content: center;
        padding: 8px 4px;
    }
    .admin-main {
        margin-left: 60px;
    }
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .panel-row {
        grid-template-columns: 1fr;
    }
    .form-horizontal .form-row {
        flex-direction: column;
    }
    .form-label {
        width: auto;
        text-align: left;
        padding-right: 0;
        padding-top: 0;
        margin-bottom: 8px;
    }
    .form-control {
        flex: none;
        width: 100%;
        min-width: 0;
    }
    .upload-area {
        width: 100% !important;
        max-width: 240px;
        height: 240px;
        margin: 0 auto;
        flex-shrink: 0;
    }
}

/* ===== 手机适配 (<= 768px) ===== */
@media (max-width: 768px) {
    /* 防止横向溢出导致上传框等元素被推出可视区域 */
    body {
        overflow-x: hidden;
        max-width: 100vw;
    }
    .admin-layout {
        max-width: 100vw;
        overflow-x: hidden;
    }
    /* 侧边栏变为抽屉 */
    .admin-sidebar {
        width: 240px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 2px 0 24px rgba(0, 0, 0, 0.15);
    }
    .admin-sidebar.show {
        transform: translateX(0);
    }
    /* 恢复侧边栏文字显示 */
    .sidebar-logo .logo-text,
    .nav-item span:not(.nav-icon),
    .logout-btn span:not(:first-child),
    .user-info > div:not(.user-avatar) {
        display: block;
    }
    .sidebar-logo {
        justify-content: flex-start;
        padding: 24px 20px;
    }
    .nav-item {
        justify-content: flex-start;
        padding: 12px 16px;
    }
    .user-info {
        justify-content: flex-start;
        padding: 12px 16px;
    }
    .user-info > div:not(.user-avatar) {
        display: block;
    }
    .admin-main {
        margin-left: 0;
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* 汉堡菜单按钮 */
    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 36px;
        height: 36px;
        border: none;
        background: transparent;
        cursor: pointer;
        padding: 0;
        margin-right: 12px;
        flex-shrink: 0;
    }
    .mobile-menu-toggle span {
        display: block;
        height: 3px;
        width: 22px;
        background: #333;
        border-radius: 2px;
        transition: all 0.3s;
    }
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* 遮罩层 */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 99;
    }
    .sidebar-overlay.show {
        display: block;
    }

    /* 头部和内容间距缩小 */
    .admin-header {
        padding: 12px 16px;
        justify-content: flex-start;
    }
    .admin-header h2 {
        font-size: 17px;
    }
    .header-right {
        margin-left: auto;
    }
    .admin-content {
        padding: 16px;
        overflow-x: hidden;
    }

    /* 统计卡片：2列，缩小尺寸 */
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-bottom: 16px;
    }
    .stat-card {
        padding: 14px;
        gap: 10px;
        border-radius: 12px;
    }
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
        border-radius: 10px;
    }
    .stat-label {
        font-size: 12px;
        margin-bottom: 4px;
    }
    .stat-value {
        font-size: 18px;
    }
    .stat-value.small {
        font-size: 14px;
    }

    /* 面板间距缩小 */
    .panel-row {
        gap: 16px;
        margin-bottom: 16px;
    }
    .panel {
        margin-bottom: 16px;
        border-radius: 12px;
    }
    .panel-header {
        padding: 16px;
    }
    .panel-header h3 {
        font-size: 15px;
    }
    .panel-body {
        padding: 16px;
        overflow-x: hidden;
    }

    /* 二维码网格：单列 */
    .qr-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .qr-card-thumb {
        aspect-ratio: 16/9;
    }

    /* 表单堆叠 */
    .form-horizontal .form-row {
        flex-direction: column;
        margin-bottom: 18px;
    }
    .form-label {
        width: auto;
        text-align: left;
        padding-right: 0;
        padding-top: 0;
        margin-bottom: 8px;
    }
    .form-control input[type="text"],
    .form-control input[type="number"],
    .form-control input[type="password"],
    .form-control textarea,
    .form-select {
        height: 42px;
        font-size: 15px;
    }

    /* 上传区域：改为横向按钮式，确保稳定可见且像可点击按钮 */
    .form-control {
        flex: none;
        width: 100%;
        min-width: 0;
    }
    .upload-area {
        width: 100% !important;
        max-width: 100% !important;
        height: 56px !important;
        margin: 0 !important;
        border: 1.5px solid #07C160 !important;
        border-radius: 10px !important;
        background: #F0FFF4 !important;
        flex-shrink: 0;
        box-sizing: border-box;
    }
    .upload-area:hover {
        border-color: #07C160;
        background: #E6FCEC;
    }
    .upload-placeholder {
        position: static;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        padding: 0 16px;
        height: 100%;
        box-sizing: border-box;
    }
    .upload-icon {
        font-size: 22px;
        margin-bottom: 0;
        flex-shrink: 0;
    }
    .upload-text {
        font-size: 14px;
        color: #07C160;
        font-weight: 500;
        margin-bottom: 0;
        flex: 1;
        text-align: left;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .upload-tip {
        display: none;
    }
    .upload-preview {
        width: 100%;
        height: 100%;
        position: relative;
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 0 16px;
        box-sizing: border-box;
    }
    .upload-preview img {
        width: 40px;
        height: 40px;
        object-fit: cover;
        border-radius: 6px;
        flex-shrink: 0;
    }
    .preview-mask {
        position: static;
        background: transparent;
        color: #07C160;
        font-size: 13px;
        font-weight: 500;
        opacity: 1;
    }

    /* 筛选栏堆叠 */
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .filter-tabs {
        justify-content: center;
    }
    .filter-select-wrap {
        margin-left: 0;
    }
    .filter-select {
        width: 100%;
        min-width: 0;
    }

    /* 福利输入行适配 */
    .benefit-input-row {
        flex-wrap: wrap;
    }
    .benefit-input-row input {
        min-width: 0;
        flex: 1 1 200px;
    }

    /* 按钮：全宽 */
    .btn-primary,
    .btn-outline {
        width: 100%;
        justify-content: center;
        margin-left: 0;
    }
    .btn-outline {
        margin-top: 10px;
    }

    /* 分页 */
    .pagination {
        flex-wrap: wrap;
        gap: 6px;
    }
    .page-btn {
        min-width: 32px;
        height: 32px;
        font-size: 13px;
        padding: 0 8px;
    }

    /* 表格：缩小字号 */
    .data-table {
        font-size: 13px;
    }
    .data-table th,
    .data-table td {
        padding: 10px 12px;
        white-space: nowrap;
    }

    /* 快捷操作卡片 */
    .action-card {
        padding: 12px;
        gap: 12px;
    }
    .action-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    .action-title {
        font-size: 14px;
    }
    .action-desc {
        font-size: 12px;
    }

    /* 配额条 */
    .quota-bar {
        padding: 12px 16px;
    }

    /* 弹窗：接近全宽 */
    .modal-box {
        width: 94%;
        max-width: none;
        border-radius: 12px;
    }
    .promo-qr-img {
        width: 200px;
        height: 200px;
    }
    .modal-body {
        padding: 16px;
    }
    .modal-header {
        padding: 16px;
    }
    .modal-footer {
        padding: 12px 16px 16px;
        flex-direction: column;
        gap: 10px;
    }
    .modal-footer button {
        width: 100%;
    }

    /* 最近列表 */
    .recent-thumb {
        width: 40px;
        height: 40px;
    }
    .recent-name {
        font-size: 13px;
    }
    .recent-meta {
        font-size: 11px;
    }

    /* 登录页适配 */
    .login-container {
        padding: 16px;
    }
    .login-card {
        padding: 32px 24px;
        border-radius: 16px;
    }
    .login-logo h1 {
        font-size: 20px;
    }
    .login-form .form-group input {
        height: 44px;
        font-size: 16px; /* iOS 防止缩放：>=16px */
    }
    .btn-login {
        height: 46px;
        font-size: 16px;
    }

    /* 设置页内联样式覆盖 */
    .logo-upload-area {
        width: 100%;
        max-width: 100%;
        height: 56px;
    }
}

/* ===== 超小屏幕 (<= 375px) ===== */
@media (max-width: 375px) {
    .stats-row {
        grid-template-columns: 1fr;
    }
    .stat-card {
        padding: 12px;
    }
    .admin-header h2 {
        font-size: 16px;
    }
    .btn-primary-sm,
    .btn-outline-sm {
        padding: 6px 12px;
        font-size: 13px;
    }
}

/* ============================================================
   v2 新功能样式：轮换码 / 中转页 / 自定义路径 / 模板库 / flag / 统计 / 日志 / 一键复制
   ============================================================ */

/* 模板库卡片 */
.template-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 8px;
}
.template-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1.5px solid #E8E8E8;
    border-radius: 10px;
    cursor: pointer;
    background: #FAFAFA;
    transition: all 0.2s;
    user-select: none;
}
.template-card:hover {
    border-color: #07C160;
    background: #F0FFF4;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(7, 193, 96, 0.12);
}
.template-card.selected {
    border-color: #07C160;
    background: #E6F9EE;
    box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.15);
}
.template-icon {
    font-size: 28px;
    width: 40px;
    text-align: center;
    flex-shrink: 0;
}
.template-info { flex: 1; min-width: 0; }
.template-name {
    font-size: 14px;
    font-weight: 600;
    color: #1A1A1A;
    margin-bottom: 2px;
}
.template-desc {
    font-size: 12px;
    color: #999;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 自定义路径 slug 输入框 */
.slug-input-wrap {
    display: flex;
    align-items: center;
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    overflow: hidden;
    background: #FAFAFA;
    transition: all 0.2s;
}
.slug-input-wrap:focus-within {
    border-color: #07C160;
    box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.1);
    background: #fff;
}
.slug-prefix {
    padding: 0 12px;
    color: #999;
    font-size: 14px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    background: #F0F0F0;
    align-self: stretch;
    display: flex;
    align-items: center;
}
.slug-input-wrap input {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px 12px;
    font-size: 14px;
    background: transparent;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* 轮换码子项列表 */
.rotation-items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.rotation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #E8E8E8;
    border-radius: 8px;
    background: #FAFAFA;
}
.rotation-item-thumb {
    width: 56px;
    height: 56px;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #E8E8E8;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rotation-item-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.rotation-item-fields {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    flex: 1;
}
.rotation-field {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #555;
}
.rotation-weight-input {
    width: 64px;
    padding: 4px 8px;
    border: 1px solid #E5E5E5;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}
.rotation-weight-input:focus { border-color: #07C160; }
.rotation-status-field,
.rotation-delete-field { cursor: pointer; }
.rotation-hits {
    font-size: 12px;
    color: #999;
    background: #F0F0F0;
    padding: 2px 8px;
    border-radius: 10px;
}
.rotation-delete-field { color: #FF4D4F; }

/* 中转页表单 */
#transitSettings textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    font-size: 13px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    resize: vertical;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
}
#transitSettings textarea:focus {
    border-color: #07C160;
    box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.1);
}

/* 列表卡片 flag 标签 */
.qr-card-flags {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-width: calc(100% - 16px);
    z-index: 2;
}
.flag-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 10px;
    color: #fff;
    font-weight: 500;
    backdrop-filter: blur(4px);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.flag-rotation { background: rgba(124, 77, 255, 0.85); }
.flag-transit  { background: rgba(255, 140, 0, 0.85); }
.flag-slug     { background: rgba(24, 144, 255, 0.85); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* 一键复制按钮反馈 */
.btn-link.copied { color: #07C160; font-weight: 600; }
.btn-link.copy-failed { color: #FF4D4F; }

/* 统计页：筛选表单 */
.stats-filter-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.stats-filter-form .filter-tabs {
    display: inline-flex;
    background: #F5F7FA;
    border-radius: 6px;
    padding: 2px;
    gap: 2px;
}
.stats-filter-form .filter-tabs .filter-tab {
    padding: 5px 12px;
    font-size: 12px;
    border-radius: 4px;
    color: #666;
    text-decoration: none;
    transition: all 0.2s;
}
.stats-filter-form .filter-tabs .filter-tab:hover {
    color: #333;
    background: rgba(255, 255, 255, 0.5);
}
.stats-filter-form .filter-tabs .filter-tab.active {
    background: #fff;
    color: #07C160;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.stats-filter-form .filter-select {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #E5E5E5;
    background: #fff;
    font-size: 13px;
    outline: none;
}

/* 趋势柱状图 */
.trend-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 200px;
    padding: 12px 4px 0;
    overflow-x: auto;
}
.trend-bar-col {
    flex: 1 0 24px;
    min-width: 24px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    cursor: default;
}
.trend-bar {
    width: 70%;
    min-height: 2px;
    background: linear-gradient(180deg, #07C160 0%, #00D26A 100%);
    border-radius: 4px 4px 0 0;
    transition: height 0.3s;
}
.trend-bar-col:hover .trend-bar {
    background: linear-gradient(180deg, #06A050 0%, #00B85A 100%);
}
.trend-count {
    font-size: 10px;
    color: #666;
    line-height: 1;
}
.trend-date {
    font-size: 10px;
    color: #999;
    line-height: 1;
    transform: rotate(-45deg);
    transform-origin: center;
    white-space: nowrap;
}

/* 来源分布 */
.source-list { display: flex; flex-direction: column; gap: 14px; }
.source-item {}
.source-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 13px;
}
.source-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.source-name { color: #333; font-weight: 500; }
.source-count { color: #999; margin-left: auto; font-size: 12px; }
.source-bar {
    height: 8px;
    background: #F0F0F0;
    border-radius: 4px;
    overflow: hidden;
}
.source-bar-fill { height: 100%; border-radius: 4px; transition: width 0.4s; }

/* TOP 榜 */
.top-list { display: flex; flex-direction: column; gap: 10px; }
.top-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 4px;
}
.top-rank {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #F0F0F0;
    color: #999;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.top-rank.rank-1 { background: linear-gradient(135deg, #FFD700, #FFA500); color: #fff; }
.top-rank.rank-2 { background: linear-gradient(135deg, #C0C0C0, #A8A8A8); color: #fff; }
.top-rank.rank-3 { background: linear-gradient(135deg, #CD7F32, #B06830); color: #fff; }
.top-info { flex: 1; min-width: 0; }
.top-name {
    font-size: 13px;
    color: #333;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.top-meta { color: #999; font-size: 11px; font-weight: 400; }
.top-bar {
    height: 6px;
    background: #F0F0F0;
    border-radius: 3px;
    overflow: hidden;
}
.top-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #07C160, #00D26A);
    border-radius: 3px;
}
.top-count {
    font-size: 14px;
    font-weight: 700;
    color: #07C160;
    min-width: 50px;
    text-align: right;
}
.top-link {
    font-size: 12px;
    color: #07C160;
    text-decoration: none;
}
.top-link:hover { text-decoration: underline; }

/* 日志页筛选表单 */
.logs-filter-form { margin: 0; }
.filter-inline {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.filter-inline .filter-select,
.filter-inline .filter-input {
    padding: 7px 10px;
    border: 1px solid #E5E5E5;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
}
.filter-inline .filter-input { width: auto; min-width: 120px; }
.filter-inline .filter-select:focus,
.filter-inline .filter-input:focus {
    border-color: #07C160;
    box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.1);
}
.filter-sep { color: #999; font-size: 13px; }

/* 日志表格 */
.log-table .log-detail {
    font-size: 12px;
    color: #555;
    max-width: 320px;
    word-break: break-all;
}
.log-table .log-ip {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    color: #666;
}
.log-table .log-ua {
    font-size: 11px;
    color: #999;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 通用文字辅助类 */
.text-center { text-align: center; }
.text-muted { color: #999; }
.text-danger { color: #FF4D4F; font-weight: 600; }
.text-warning { color: #FF8C00; font-weight: 600; }
.text-success { color: #07C160; font-weight: 600; }

/* 响应式 */
@media (max-width: 768px) {
    .template-gallery { grid-template-columns: 1fr; }
    .trend-chart { height: 160px; }
    .trend-bar-col { flex: 1 0 16px; min-width: 16px; }
    .trend-date { display: none; }
    .filter-inline { flex-direction: column; align-items: stretch; }
    .filter-inline .filter-input,
    .filter-inline .filter-select { width: 100%; }
    .log-table .log-ua { display: none; }
    .qr-card-flags { flex-direction: column; max-width: 80px; }

    /* 统计页：筛选区在手机端垂直堆叠，与二维码管理一致 */
    .stats-filter-form {
        flex-wrap: wrap;
        gap: 6px;
        width: 100%;
    }
    .stats-filter-form .filter-select {
        flex: 1 1 calc(50% - 4px);
        min-width: 0;
        padding: 8px 10px;
        font-size: 13px;
    }
    .stats-filter-form .filter-select option {
        font-size: 14px;
    }
    .stats-filter-form .filter-tabs {
        width: 100%;
        justify-content: stretch;
    }
    .stats-filter-form .filter-tabs .filter-tab {
        flex: 1;
        text-align: center;
        padding: 7px 10px;
        font-size: 13px;
    }

    /* 复用 .filter-bar 的堆叠规则：让筛选区在 panel 外也能垂直堆叠 */
    .filter-bar .stats-filter-form {
        flex: 1 1 100%;
    }
    .filter-bar .filter-select-wrap {
        flex: 1 1 100%;
        margin-left: 0;
    }
    .filter-bar .filter-select-wrap .filter-select {
        width: 100%;
    }

    /* 统计页：panel-row 单列 */
    .panel-row {
        grid-template-columns: 1fr;
    }

    /* 统计页：趋势图横向可滚动 */
    .trend-chart {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* 统计页：TOP10 列表紧凑化 */
    .top-item {
        gap: 8px;
        padding: 8px 0;
    }
    .top-rank {
        width: 22px;
        height: 22px;
        font-size: 11px;
    }
    .top-name { font-size: 12px; }
    .top-meta { font-size: 10px; }
    .top-count {
        font-size: 13px;
        min-width: 40px;
    }
    .top-link { font-size: 11px; }

    /* 统计页：即将到期表横向滚动 */
    .panel-body .table-wrapper {
        margin: -16px;
        padding: 0;
    }
    .data-table {
        min-width: 560px;
    }

    /* 统计卡片：紧凑 */
    .stat-card {
        padding: 12px;
        gap: 8px;
    }
    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
    .stat-value { font-size: 16px; }

    /* URL 输入框在手机端字号防止 iOS 缩放 */
    .form-control .url-input-wrap input[type="url"] {
        font-size: 15px;
    }

    /* 轮换子项已上传列表：横向滚动 */
    .rotation-items-list {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .rotation-item {
        flex: 0 0 200px;
    }

    /* 文件上传 chip：换行 */
    .form-control .file-upload-list .file-chip {
        max-width: 100%;
    }

    /* 二维码卡片操作行：次操作 3 个按钮均匀分布 */
    .qr-card-actions-row.secondary .btn-link {
        font-size: 12px;
        padding: 5px 4px;
    }
}

@media (max-width: 375px) {
    /* 统计页超小屏：筛选 select 单列 */
    .stats-filter-form .filter-select {
        flex: 1 1 100%;
    }
    /* 统计卡片单列 */
    .stats-row {
        grid-template-columns: 1fr;
    }
}

