:root {
    --primary-color: #4f46e5;
    --primary-color-hover: #4338ca;
    --accent-color: #f43f5e;
    --background-color: #f8fafc;
    --text-color: #0f172a;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
}

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

html,
body {
    scroll-behavior: smooth;
}

body {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-color-hover);
}

/* Header */
.global-header {
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.9) 0%, rgba(124, 58, 237, 0.9) 100%);
    color: white;
    padding: 0.75rem 0;
    box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.glass-header {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-text {
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(to bottom, #ffffff 0%, #e0e7ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.site-logo {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: white;
    padding: 3px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.site-title a:hover .site-logo {
    transform: rotate(15deg) scale(1.1);
}

.site-title a {
    color: white;
    text-decoration: none;
}

.global-nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.global-nav a {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

.global-nav a:hover {
    color: white;
    text-decoration: underline;
}

/* Breadcrumb */
.breadcrumb {
    max-width: 1200px;
    margin: 1.5rem auto 0;
    padding: 0 1rem;
    font-size: 0.875rem;
    color: #64748b;
}

.breadcrumb a {
    color: var(--primary-color);
}

/* Layout Container */
.container {
    max-width: 1200px;
    margin: 1.5rem auto;
    padding: 0 1rem;
    display: flex;
    gap: 2rem;
}

.main-content {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: 300px;
    flex-shrink: 0;
    position: sticky;
    top: 2rem;
    height: min-content;
    align-self: flex-start;
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }
}

/* App Tool Area Styling */
.tool-wrapper {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.tool-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tool-title i {
    color: var(--primary-color);
}

.tool-desc {
    color: #64748b;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.tool-body {
    margin-bottom: 2rem;
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.seo-content {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px dashed var(--border-color);
}

.seo-content h2 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    color: var(--text-color);
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
}

.seo-content h3 {
    font-size: 1.25rem;
    margin: 1.5rem 0 0.75rem;
    color: #334155;
}

.seo-content p {
    margin-bottom: 1.25rem;
    color: #475569;
    line-height: 1.7;
}

/* Buttons and Inputs */
input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 1.25rem;
    transition: border-color 0.2s;
    background: white;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
}

button.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-color-hover) 100%);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s;
    width: 100%;
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
}

button.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(79, 70, 229, 0.4);
}

button.btn-primary:active {
    transform: translateY(1px);
}

/* Lists (Remove dots) */
ul.widget-list,
ul.related-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

ul.widget-list li,
ul.related-list li {
    margin-bottom: 0.4rem;
    /* Reduced from 0.75rem */
}

ul.widget-list a,
ul.related-list a {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.8rem;
    /* Reduced from 0.75rem 1rem */
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.9rem;
    /* Slightly smaller font */
    transition: all 0.2s;
}

ul.widget-list a i,
ul.related-list a i {
    width: 24px;
    color: var(--primary-color);
    margin-right: 0.5rem;
}

ul.widget-list a:hover,
ul.related-list a:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: var(--primary-color);
    text-decoration: none;
    transform: translateX(4px);
    /* ホバー時に少し右に動かす */
}

.widget-title,
.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5em;
}

.widget {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Tool Index List */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.tool-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s;
    display: block;
    color: inherit;
    position: relative;
    overflow: hidden;
}

/* カード上部にグラデーションのラインを引く装飾 */
.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    opacity: 0;
    transition: opacity 0.2s;
}

.tool-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
    /* ホバーで少し浮き上がる */
    border-color: #cbd5e1;
    text-decoration: none;
}

.tool-card:hover::before {
    opacity: 1;
    /* ホバー時に上のラインを表示 */
}

.tool-card h3 {
    color: var(--text-color);
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tool-card h3 i {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.tool-card p {
    font-size: 0.95rem;
    color: #64748b;
    line-height: 1.5;
}

/* Footer */
.global-footer {
    background-color: var(--text-color);
    color: #94a3b8;
    padding: 3rem 0;
    margin-top: 4rem;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-links {
    margin-top: 1rem;
}

.footer-links a {
    color: #cbd5e1;
    margin: 0 0.75rem;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: white;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-color-hover) 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.5);
    color: white;
}

.back-to-top:active {
    transform: scale(0.9);
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

/* Share Buttons */
.share-container {
    margin: 3rem 0;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: center;
    margin-bottom: 3rem;
}

.share-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #475569;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.2s;
    text-decoration: none;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: white;
    text-decoration: none;
}

.share-btn.x {
    background: #000000;
}

.share-btn.fb {
    background: #1877f2;
}

.share-btn.line {
    background: #06c755;
}

.share-btn i {
    font-size: 1.1rem;
}

/* Sidebar Social Widgets */
.social-widget {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 2.5rem;
}

.social-widget .widget-title {
    color: white;
}

.social-link-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    transition: background 0.2s;
    text-align: left;
}

.social-link-item:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
}

.social-link-item i {
    font-size: 1.5rem;
}

@media (max-width: 640px) {
    .share-buttons {
        flex-direction: column;
    }

    .share-btn {
        width: 100%;
        justify-content: center;
    }
}
/* Ranking UI (Hidden by default) */
.ranking-section {
    display: none;
    margin-top: 3rem;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.ranking-section.show-dev {
    display: block; /* For manual check via DevTools */
}

.ranking-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ranking-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

.ranking-table th {
    text-align: left;
    padding: 0.75rem;
    color: #64748b;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ranking-table tr td {
    background: #f8fafc;
    padding: 1rem;
    transition: transform 0.2s;
}

.ranking-table tr td:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    font-weight: 800;
    width: 60px;
    text-align: center;
}

.ranking-table tr td:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    text-align: right;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

.ranking-table tr.top-1 td:first-child { color: #f59e0b; background: #fffbeb; }
.ranking-table tr.top-2 td:first-child { color: #94a3b8; background: #f1f5f9; }
.ranking-table tr.top-3 td:first-child { color: #b45309; background: #fef3c7; }

.ranking-user-highlight td {
    background: #eef2ff !important;
    border: 1px solid #c7d2fe;
}
