/* =====================================================
   店铺信息收集系统 - 全局样式文件
   ===================================================== */

/* ===== 全局样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background: #f5f7fa;
    padding: 20px 10px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

/* ===== 头部样式 ===== */
header {
    text-align: center;
    margin-bottom: 20px;
}

header h1 {
    font-size: 1.8rem;
    color: #2c3e50;
    font-weight: 400;
    border-bottom: 2px solid #3498db;
    display: inline-block;
    padding-bottom: 8px;
}

/* ===== 卡片组件 ===== */
.card {
    background: white;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    padding: 24px 20px;
    margin-bottom: 25px;
    transition: 0.2s;
    animation: fadeIn 0.3s ease-out;
}

.card h2 {
    font-size: 1.3rem;
    margin-bottom: 18px;
    color: #2c3e50;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #34495e;
    font-weight: 500;
}

/* ===== 表单样式 ===== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #4a5568;
    font-size: 0.95rem;
}

.form-group label .required {
    color: #e53e3e;
    margin-left: 2px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    font-size: 1rem;
    transition: 0.2s;
    background: #fafbfc;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52,152,219,0.1);
    background: white;
}

.form-group input::placeholder,
.form-group select::placeholder,
.form-group textarea::placeholder {
    color: #a0aec0;
    font-size: 0.95rem;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #7f8c8d;
    font-size: 0.85rem;
}

/* ===== 按钮样式 ===== */
.btn {
    border: none;
    border-radius: 40px;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    width: 100%;
    text-align: center;
    display: inline-block;
    text-decoration: none;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52,152,219,0.3);
}

.btn-secondary {
    background: #ecf0f1;
    color: #2c3e50;
}

.btn-secondary:hover {
    background: #bdc3c7;
    transform: translateY(-2px);
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #2ecc71;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46,204,113,0.3);
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231,76,60,0.3);
}

.btn-purple {
    background: #9b59b6;
    color: white;
}

.btn-purple:hover {
    background: #8e44ad;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(155,89,182,0.3);
}

.btn-export {
    display: inline-block;
    background: #27ae60;
    color: white;
    padding: 12px 30px;
    border-radius: 40px;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 20px;
    border: none;
    cursor: pointer;
    transition: 0.2s;
}

.btn-export:hover {
    background: #2ecc71;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.3);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-icon {
    padding: 5px 10px;
    font-size: 0.85rem;
}

/* 按钮组布局 */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.action-buttons .btn {
    flex: 1;
}

/* ===== 搜索区域样式 ===== */
.search-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-wrapper .form-group {
    flex: 3;
    margin-bottom: 0;
}

.search-wrapper .btn-search {
    flex: 1;
    min-width: 70px;
    padding: 14px 0;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    white-space: nowrap;
}

.search-wrapper .btn-search:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52,152,219,0.3);
}

.clear-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #95a5a6;
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-left: 10px;
    transition: 0.2s;
    border: none;
    cursor: pointer;
}

.clear-btn:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
}

.search-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding: 10px 0;
    border-bottom: 1px solid #ecf0f1;
}

.search-status .result-count {
    color: #2c3e50;
    font-weight: 500;
}

/* ===== 提示消息样式 ===== */
.success {
    background: #d4edda;
    color: #155724;
    padding: 12px;
    border-radius: 16px;
    margin-bottom: 20px;
    text-align: center;
    border-left: 4px solid #28a745;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 16px;
    margin-bottom: 20px;
    text-align: center;
    border-left: 4px solid #dc3545;
}

.info {
    background: #d1ecf1;
    color: #0c5460;
    padding: 12px;
    border-radius: 16px;
    margin-bottom: 20px;
    text-align: center;
    border-left: 4px solid #17a2b8;
}

/* ===== 店铺卡片样式 ===== */
.shop-item {
    background: #f8fafc;
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 12px;
    border-left: 4px solid #3498db;
    transition: 0.2s;
    animation: fadeIn 0.3s ease-out;
}

.shop-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.shop-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.shop-detail {
    color: #4a5568;
    margin: 4px 0;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.shop-detail:before {
    content: "•";
    color: #3498db;
    font-weight: bold;
    margin-right: 4px;
}

/* ===== 空数据样式 ===== */
.no-data {
    text-align: center;
    color: #7f8c8d;
    padding: 30px 0;
}

.no-data p {
    margin-bottom: 15px;
}

/* ===== 表格样式 (PC端) ===== */
.table-responsive {
    overflow-x: auto;
    border-radius: 24px;
    background: white;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

th {
    background: #3498db;
    color: white;
    font-weight: 500;
    padding: 16px 12px;
    text-align: left;
    font-size: 0.95rem;
    white-space: nowrap;
}

td {
    padding: 14px 12px;
    border-bottom: 1px solid #ecf0f1;
    color: #2c3e50;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: #f8fafc;
}

/* ===== 状态徽章 ===== */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-enabled {
    background: #d4edda;
    color: #155724;
}

.status-disabled {
    background: #f8d7da;
    color: #721c24;
}

.type-badge {
    background: #e2e8f0;
    color: #2c3e50;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
}

.verified-badge {
    background: #cce5ff;
    color: #004085;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.8rem;
}

/* ===== 操作按钮样式 ===== */
.btn-action {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 4px;
    border-radius: 20px;
    font-size: 0.9rem;
    text-decoration: none;
    color: white;
    transition: 0.2s;
    border: none;
    cursor: pointer;
}

.btn-edit {
    background: #3498db;
}

.btn-edit:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(52,152,219,0.3);
}

.btn-delete {
    background: #e74c3c;
}

.btn-delete:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(231,76,60,0.3);
}

.btn-view {
    background: #27ae60;
}

.btn-view:hover {
    background: #2ecc71;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(39,174,96,0.3);
}

.action-group {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

/* ===== 菜单管理样式 ===== */
.menu-container {
    margin-top: 20px;
}

.menu-level1 {
    background: #f8fafc;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #3498db;
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.menu-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

.menu-type {
    background: #e2e8f0;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    margin-left: 10px;
}

.menu-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.menu-level2 {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    padding-left: 20px;
}

.submenu-item {
    background: white;
    border-radius: 8px;
    padding: 10px 15px;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1 1 calc(33.333% - 10px);
    min-width: 200px;
}

.submenu-name {
    flex: 1;
    font-weight: 500;
}

.empty-submenu {
    color: #95a5a6;
    font-style: italic;
    padding: 10px;
}

.publish-bar {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    flex-wrap: wrap;
    gap: 15px;
}

.app-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.app-selector select {
    padding: 8px 15px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.param-group {
    background: #f8fafc;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 15px;
}

/* ===== 后台管理链接样式 ===== */
.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

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

/* ===== 代码块样式 ===== */
code {
    background: #f1f1f1;
    padding: 4px 8px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #e74c3c;
}

/* ===== 页脚样式 ===== */
footer {
    text-align: center;
    color: #95a5a6;
    font-size: 0.9rem;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ecf0f1;
}

footer a {
    color: #3498db;
    text-decoration: none;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

footer a:hover {
    color: #2980b9;
    transform: translateY(-2px);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
}

/* ===== 动画效果 ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 自定义滚动条 ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #3498db;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2980b9;
}

/* ===== 响应式布局 ===== */
@media (max-width: 768px) {
    body {
        padding: 15px 8px;
    }
    
    .container {
        max-width: 100%;
    }
    
    .card {
        padding: 20px 15px;
    }
    
    .btn-export {
        display: block;
        text-align: center;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 10px;
    }
    
    .menu-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .menu-level2 {
        padding-left: 0;
    }
    
    .submenu-item {
        flex: 1 1 100%;
    }
    
    .publish-bar {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    .card h2 {
        font-size: 1.2rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px 14px;
    }
    
    .shop-item {
        padding: 15px;
    }
    
    .search-wrapper {
        flex-direction: column;
        gap: 8px;
    }
    
    .search-wrapper .form-group,
    .search-wrapper .btn-search {
        width: 100%;
        flex: none;
    }
    
    .search-status {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .clear-btn {
        margin-left: 0;
    }
    
    table {
        min-width: 600px;
    }
    
    th, td {
        padding: 10px 8px;
        font-size: 0.9rem;
    }
}

/* ===== 打印样式 ===== */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .btn,
    .btn-export,
    .btn-action,
    .search-wrapper,
    footer,
    .back-link,
    .action-group,
    .menu-actions,
    .publish-bar {
        display: none;
    }
    
    table {
        border: 1px solid #ddd;
    }
    
    th {
        background: #f0f0f0;
        color: black;
    }
}