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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

header h1 {
    color: white;
    font-size: 2.5em;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.admin-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.admin-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
    margin-bottom: 80px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 10px;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 20px 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 140px;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
    background: #fff;
    border-color: rgba(102, 126, 234, 0.2);
}

.card .icon {
    font-size: 3em;
    margin-bottom: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card .icon img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 8px;
}

.card .title {
    font-size: 0.95em;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

.card .description {
    font-size: 0.75em;
    color: #888;
    margin-top: 4px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    opacity: 0.8;
}

.card .url {
    font-size: 0.8em;
    color: #999;
    word-break: break-all;
}

.card .card-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: none;
}

.card.admin-mode .card-actions {
    display: flex;
    gap: 5px;
}

.card-actions button {
    background: rgba(0, 0, 0, 0.1);
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
}

.card-actions button:hover {
    background: rgba(0, 0, 0, 0.2);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #333;
}

.modal-content input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-buttons button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.modal-buttons button:first-child {
    background: #667eea;
    color: white;
}

.modal-buttons button:first-child:hover {
    background: #5568d3;
}

.modal-buttons button:last-child {
    background: #e0e0e0;
    color: #333;
}

.modal-buttons button:last-child:hover {
    background: #d0d0d0;
}

.admin-toolbar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 15px 30px;
    border-radius: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    gap: 15px;
    z-index: 100;
}

.admin-toolbar button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.admin-toolbar button:first-child {
    background: #667eea;
    color: white;
}

.admin-toolbar button:first-child:hover {
    background: #5568d3;
}

.admin-toolbar button:last-child {
    background: #f44336;
    color: white;
}

.admin-toolbar button:last-child:hover {
    background: #d32f2f;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    header {
        margin-bottom: 25px;
    }

    header h1 {
        font-size: 1.8em;
    }

    .admin-btn {
        position: static;
        transform: none;
        margin-top: 15px;
        display: block;
        font-size: 13px;
        padding: 8px 18px;
    }

    .cards-container {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 15px;
        margin-bottom: 60px;
        padding: 0;
    }

    .card {
        padding: 18px 12px;
        border-radius: 10px;
        min-height: 130px;
    }

    .card .icon {
        font-size: 2.5em;
        margin-bottom: 10px;
    }

    .card .icon img {
        width: 48px;
        height: 48px;
    }

    .card .title {
        font-size: 0.9em;
        margin-bottom: 4px;
    }

    .card .description {
        font-size: 0.7em;
    }

    .admin-toolbar {
        flex-direction: column;
        padding: 12px;
        width: 90%;
    }

    .admin-toolbar button {
        width: 100%;
        padding: 10px 18px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 12px;
    }

    header {
        margin-bottom: 20px;
    }

    header h1 {
        font-size: 1.5em;
    }

    .cards-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-bottom: 50px;
    }

    .card {
        padding: 16px 10px;
        border-radius: 10px;
        min-height: 120px;
    }

    .card .icon {
        font-size: 2.2em;
        margin-bottom: 8px;
    }

    .card .icon img {
        width: 44px;
        height: 44px;
    }

    .card .title {
        font-size: 0.85em;
        line-height: 1.3;
    }

    .card .description {
        font-size: 0.65em;
        margin-top: 3px;
    }

    .card .card-actions {
        top: 5px;
        right: 5px;
    }

    .card-actions button {
        padding: 4px 8px;
        font-size: 10px;
    }
}

/* 排序按钮样式 */
.card-actions button:first-child,
.card-actions button:nth-child(2) {
    background: #4CAF50;
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.card-actions button:first-child:hover,
.card-actions button:nth-child(2):hover {
    background: #45a049;
}

.card-actions button:nth-child(3) {
    background: #2196F3;
    color: white;
}

.card-actions button:nth-child(3):hover {
    background: #1976D2;
}

.card-actions button:last-child {
    background: #f44336;
    color: white;
}

.card-actions button:last-child:hover {
    background: #d32f2f;
}

/* 公告模态框样式（参考订菜系统的确认模态框样式） */
.announcement-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.announcement-modal.flex {
    display: flex;
}

.announcement-modal-content {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    border-radius: 12px;
    padding: 28px;
    max-width: 550px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(255, 152, 0, 0.4);
    position: relative;
    animation: announcementSlideIn 0.3s ease-out;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

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

.announcement-modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.announcement-modal-icon {
    font-size: 48px;
    color: white;
    animation: announcementBounce 1.5s infinite;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

@keyframes announcementBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

.announcement-modal-title {
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.announcement-modal-body {
    margin-bottom: 24px;
    min-height: 60px;
    background: rgba(255, 255, 255, 0.15);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.announcement-modal-text {
    font-size: 24px;
    line-height: 1.8;
    color: white;
    font-weight: 700;
    word-wrap: break-word;
    white-space: pre-wrap;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.announcement-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

.announcement-modal-btn {
    padding: 12px 28px;
    border-radius: 8px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.announcement-modal-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: rgba(255, 152, 0, 0.3);
    transition: width var(--press-duration, 1s) linear;
    z-index: 0;
    border-radius: 8px;
}

.announcement-modal-btn.pressing::before {
    width: 100%;
}

.announcement-modal-btn span,
.announcement-modal-btn i {
    position: relative;
    z-index: 1;
}

.announcement-modal-btn-primary {
    background: white;
    color: #ff9800;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    user-select: none;
    -webkit-user-select: none;
}

.announcement-modal-btn-primary:hover {
    background: #fff5e6;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.announcement-modal-btn-primary:active {
    transform: translateY(0);
}

/* 移动端公告模态框样式 */
@media (max-width: 480px) {
    .announcement-modal-content {
        padding: 24px 20px;
        max-width: 95%;
    }

    .announcement-modal-header {
        margin-bottom: 20px;
        padding-bottom: 14px;
    }

    .announcement-modal-icon {
        font-size: 42px;
    }

    .announcement-modal-body {
        padding: 18px;
        margin-bottom: 20px;
    }

    .announcement-modal-text {
        font-size: 20px;
        line-height: 1.7;
    }

    .announcement-modal-footer {
        flex-direction: column;
        gap: 10px;
        padding-top: 16px;
    }

    .announcement-modal-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 24px;
        font-size: 16px;
    }
}